Commit 43181dc6 authored by Chris Scott's avatar Chris Scott

Fix param config. turn on persistence

parent 1d6809de
...@@ -116,34 +116,24 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -116,34 +116,24 @@ public class LocationUpdateService extends Service implements LocationListener {
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
Log.i(TAG, "Received start id " + startId + ": " + intent); Log.i(TAG, "Received start id " + startId + ": " + intent);
if (intent != null) { if (intent != null) {
this.authToken = intent.getStringExtra("authToken"); authToken = intent.getStringExtra("authToken");
this.url = intent.getStringExtra("url"); url = intent.getStringExtra("url");
this.stationaryRadius = Float.parseFloat(intent.getStringExtra("stationaryRadius")); stationaryRadius = Float.parseFloat(intent.getStringExtra("stationaryRadius"));
distanceFilter = Integer.parseInt(intent.getStringExtra("distanceFilter")); distanceFilter = Integer.parseInt(intent.getStringExtra("distanceFilter"));
if (distanceFilter == null) { desiredAccuracy = Integer.parseInt(intent.getStringExtra("desiredAccuracy"));
distanceFilter = 30; locationTimeout = Integer.parseInt(intent.getStringExtra("locationTimeout"));
} isDebugging = Boolean.parseBoolean(intent.getStringExtra("isDebugging"));
this.desiredAccuracy = Integer.parseInt(intent.getStringExtra("desiredAccuracy"));
if (desiredAccuracy == null) { if (isDebugging) {
desiredAccuracy = 100;
}
this.locationTimeout = Integer.parseInt(intent.getStringExtra("locationTimeout"));
if (locationTimeout == null) {
locationTimeout = 60;
}
this.isDebugging = Boolean.parseBoolean(intent.getStringExtra("isDebugging"));
if (this.isDebugging == null) {
this.isDebugging = false;
}
if (this.isDebugging) {
toneGenerator = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, 100); toneGenerator = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, 100);
} }
Log.i(TAG, "- stationaryRadius: " + stationaryRadius); Log.i(TAG, "- url: " + url);
Log.i(TAG, "- distanceFilter: " + distanceFilter); Log.i(TAG, "- token: " + authToken);
Log.i(TAG, "- desiredAccuracy: " + desiredAccuracy); Log.i(TAG, "- stationaryRadius: " + stationaryRadius);
Log.i(TAG, "- locationTimeout: " + locationTimeout); Log.i(TAG, "- distanceFilter: " + distanceFilter);
Log.i(TAG, "- isDebugging: " + isDebugging); Log.i(TAG, "- desiredAccuracy: " + desiredAccuracy);
Log.i(TAG, "- locationTimeout: " + locationTimeout);
Log.i(TAG, "- isDebugging: " + isDebugging);
} }
Toast.makeText(this, "Background location tracking started", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Background location tracking started", Toast.LENGTH_SHORT).show();
...@@ -301,11 +291,11 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -301,11 +291,11 @@ public class LocationUpdateService extends Service implements LocationListener {
// test the measurement to see if it is more accurate than the previous measurement // test the measurement to see if it is more accurate than the previous measurement
//persistLocation(location); persistLocation(location);
if (this.isNetworkConnected()) { if (this.isNetworkConnected()) {
Log.d(TAG, "Scheduling location network post"); Log.d(TAG, "Scheduling location network post");
//schedulePostLocations(); schedulePostLocations();
} else { } else {
Log.d(TAG, "Network unavailable, waiting for now"); Log.d(TAG, "Network unavailable, waiting for now");
} }
......
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