diff --git a/README.md b/README.md index 8ee1130..5657e2c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Apr 20, 2014 - v3.2.0 -Soem pretty major changes here. The android app now has google play location services running in a background service. Also updates will restart if phone is rebooted. The servers are both now using json and jquery. Xml is gone forever. Both servers now support multiple map types. It's currently set up for google maps, bing maps and OpenStreetMaps. +Some pretty major changes here. The android app now has google play location services running in a background service. Also updates will restart if phone is rebooted. The servers are both now using json and jquery. Xml is gone forever. Both servers now support multiple map types. It's currently set up for google maps, bing maps and OpenStreetMaps. ************* diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml index 5668e0a..3f745a9 100644 --- a/phoneClients/android/.idea/workspace.xml +++ b/phoneClients/android/.idea/workspace.xml @@ -41,8 +41,7 @@ - - + @@ -106,26 +105,13 @@ - + - + - - - - - - - - - - - - - @@ -134,18 +120,18 @@ - + - + - - + + @@ -589,7 +575,7 @@ @@ -994,7 +980,7 @@ - + @@ -1002,6 +988,10 @@ @@ -1071,92 +1061,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1183,9 +1087,27 @@ + + + + + + + + + + - + @@ -1415,7 +1337,7 @@ - + @@ -1427,10 +1349,10 @@ - + - + @@ -1521,19 +1443,6 @@ - - - - - - - - - - - - - @@ -1552,19 +1461,6 @@ - - - - - - - - - - - - - @@ -1575,19 +1471,6 @@ - - - - - - - - - - - - - @@ -1606,19 +1489,6 @@ - - - - - - - - - - - - - @@ -1645,19 +1515,6 @@ - - - - - - - - - - - - - @@ -1721,19 +1578,6 @@ - - - - - - - - - - - - - @@ -1752,19 +1596,6 @@ - - - - - - - - - - - - - @@ -1783,19 +1614,6 @@ - - - - - - - - - - - - - @@ -1814,19 +1632,6 @@ - - - - - - - - - - - - - @@ -2000,14 +1805,6 @@ - - - - - - - - @@ -2026,27 +1823,22 @@ - + - - - - - - - - - - - - - + + + + + + + + diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java index b46d8e5..5d32075 100644 --- a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java +++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java @@ -88,9 +88,6 @@ if (firstTimeGettingPosition) { editor.putBoolean("firstTimeGettingPosition", false); - editor.putFloat("previousLatitude", (float)location.getLatitude()); - editor.putFloat("previousLongitude", (float)location.getLongitude()); - editor.commit(); } else { Location previousLocation = new Location(""); previousLocation.setLatitude(sharedPreferences.getFloat("previousLatitude", 0f)); @@ -99,9 +96,12 @@ float distance = location.distanceTo(previousLocation); totalDistanceInMeters += distance; editor.putFloat("totalDistanceInMeters", totalDistanceInMeters); - editor.commit(); } + editor.putFloat("previousLatitude", (float)location.getLatitude()); + editor.putFloat("previousLongitude", (float)location.getLongitude()); + editor.commit(); + RequestParams requestParams = new RequestParams(); requestParams.put("latitude", Double.toString(location.getLatitude())); requestParams.put("longitude", Double.toString(location.getLongitude())); @@ -114,8 +114,7 @@ requestParams.put("locationmethod", location.getProvider()); if (sharedPreferences.getFloat("totalDistanceInMeters", 0f) > 0) { - requestParams.put("distance", sharedPreferences.getFloat("" + - "", 0f) / 1609); // in miles, + requestParams.put("distance", totalDistanceInMeters / 1609); // in miles, } else { requestParams.put("distance", 0); // in miles }