Commit 32b75b45 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

gps working + rotate screen fix

parent ec2170fb
......@@ -10,26 +10,27 @@
>
<activity android:name="starwisp"
android:configChanges="orientation"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="ObservationsActivity"></activity>
<activity android:name="ObservationsActivity" android:configChanges="orientation"></activity>
<activity android:name="GroupCompositionActivity" android:noHistory="true"></activity>
<activity android:name="PupFocalStartActivity" android:noHistory="true"></activity>
<activity android:name="PupFocalActivity" android:noHistory="true"></activity>
<activity android:name="GroupEventsActivity" android:noHistory="true"></activity>
<activity android:name="GroupCompositionActivity" android:configChanges="orientation"></activity>
<activity android:name="PupFocalStartActivity" android:configChanges="orientation"></activity>
<activity android:name="PupFocalActivity" android:configChanges="orientation"></activity>
<activity android:name="GroupEventsActivity" android:configChanges="orientation"></activity>
<activity android:name="ManagePacksActivity"></activity>
<activity android:name="NewPackActivity"></activity>
<activity android:name="ManageIndividualActivity"></activity>
<activity android:name="NewIndividualActivity"></activity>
<activity android:name="UpdateIndividualActivity"></activity>
<activity android:name="TagLocationActivity"></activity>
<activity android:name="SyncActivity"></activity>
<activity android:name="ManagePacksActivity" android:configChanges="orientation"></activity>
<activity android:name="NewPackActivity" android:configChanges="orientation"></activity>
<activity android:name="ManageIndividualActivity" android:configChanges="orientation"></activity>
<activity android:name="NewIndividualActivity" android:configChanges="orientation"></activity>
<activity android:name="UpdateIndividualActivity" android:configChanges="orientation"></activity>
<activity android:name="TagLocationActivity" android:configChanges="orientation"></activity>
<activity android:name="SyncActivity" android:configChanges="orientation"></activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
......
......@@ -761,7 +761,8 @@
(equal? (list-ref event 0) "list-files")
(equal? (list-ref event 0) "http-request")
(equal? (list-ref event 0) "network-connect")
(equal? (list-ref event 0) "delayed"))
(equal? (list-ref event 0) "delayed")
(equal? (list-ref event 0) "gps-start"))
(add-new-dialog! event)))
events)))
......
......@@ -150,8 +150,8 @@
;; standard bits
(entity-add-value! "user" "varchar" (get-current 'user-id "none"))
(entity-add-value! "time" "varchar" (date-time->string (date-time)))
(entity-add-value! "lat" "real" 0)
(entity-add-value! "lon" "real" 0)
(entity-add-value! "lat" "real" (car (get-current 'location '(0 0))))
(entity-add-value! "lon" "real" (cadr (get-current 'location '(0 0))))
(let ((values (get-current 'entity-values '())))
(cond
((not (null? values))
......@@ -1333,8 +1333,10 @@
(set-current! 'user-id user-id)
(list
(gps-start "gps" (lambda (loc)
(list (toast (number->string (car loc))
(number->string (cadr loc))))))
(set-current! 'location loc)
(list (toast (string-append
(number->string (car loc)) ", "
(number->string (cadr loc)))))))
(update-widget 'edit-text (get-id "main-id-text") 'text user-id))))
(lambda (activity) '())
(lambda (activity) '())
......
......@@ -53,7 +53,7 @@ public class DorisLocationListener implements LocationListener {
}
protected void locationChanged(double latitude, double longitude) {
m_Builder.DialogCallback(m_Context,m_Context.m_Name,m_CallbackName,String.valueOf(latitude)+" "+String.valueOf(longitude));
m_Builder.DialogCallback(m_Context,m_Context.m_Name,m_CallbackName,"("+String.valueOf(latitude)+" "+String.valueOf(longitude)+")");
}
protected void setDeviceLocation() {
......@@ -104,11 +104,11 @@ public class DorisLocationListener implements LocationListener {
|| (new Date()).getTime() - currrentLocation.getTime() > ONE_MINUTE) {
if (netAvailable) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER, 0, 0, this);
LocationManager.NETWORK_PROVIDER, 3*60*1000, 5, this);
}
if (gpsAvailable) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, 0, 0, this);
LocationManager.GPS_PROVIDER, 3*60*1000, 5, this);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment