diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml index bd4026e..d4c4d08 100644 --- a/phoneClients/android/.idea/workspace.xml +++ b/phoneClients/android/.idea/workspace.xml @@ -42,6 +42,9 @@ + + + @@ -117,21 +120,33 @@ - + - - + + + + + + + + + + + + + + - + - - + + @@ -946,15 +961,15 @@ - @@ -1424,7 +1439,7 @@ - + @@ -1440,7 +1455,7 @@ - + @@ -1931,24 +1946,26 @@ - - - - - - - - - - + + - - + + + + + + + + + + + + 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 19b8e77..53d5ec2 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 @@ -100,7 +100,7 @@ editor.putFloat("previousLatitude", (float)location.getLatitude()); editor.putFloat("previousLongitude", (float)location.getLongitude()); - editor.commit(); + editor.apply(); final RequestParams requestParams = new RequestParams(); requestParams.put("latitude", Double.toString(location.getLatitude())); @@ -136,14 +136,12 @@ Float direction = location.getBearing(); requestParams.put("direction", Integer.toString(direction.intValue())); - LoopjHttpClient test = new LoopjHttpClient(); - final String uploadWebsite = sharedPreferences.getString("defaultUploadWebsite", defaultUploadWebsite); LoopjHttpClient.get(uploadWebsite, requestParams, new AsyncHttpResponseHandler() { @Override public void onSuccess(int statusCode, org.apache.http.Header[] headers, byte[] responseBody) { - // LoopjHttpClient.debugLoopJ(TAG, "sendLocationDataToWebsite - success", uploadWebsite, requestParams, responseBody, headers, statusCode, null); + LoopjHttpClient.debugLoopJ(TAG, "sendLocationDataToWebsite - success", uploadWebsite, requestParams, responseBody, headers, statusCode, null); stopSelf(); } @Override diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java index a11d0af..2c6453e 100644 --- a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java +++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java @@ -8,6 +8,9 @@ import org.apache.http.Header; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; import java.util.Locale; public class LoopjHttpClient { @@ -23,25 +26,24 @@ public static void debugLoopJ(String TAG, String methodName,String url, RequestParams requestParams, byte[] response, Header[] headers, int statusCode, Throwable t) { - Log.e(TAG, client.getUrlWithQueryString(false, url, requestParams)); + Log.d(TAG, client.getUrlWithQueryString(false, url, requestParams)); if (headers != null) { - Log.e(TAG, methodName) - ; - Log.e(TAG, "Return Headers:"); + Log.e(TAG, methodName); + Log.d(TAG, "Return Headers:"); for (Header h : headers) { String _h = String.format(Locale.US, "%s : %s", h.getName(), h.getValue()); - Log.e(TAG, _h); + Log.d(TAG, _h); } if (t != null) { - Log.e(TAG, "Throwable:" + t); + Log.d(TAG, "Throwable:" + t); } Log.e(TAG, "StatusCode: " + statusCode); if (response != null) { - Log.e(TAG, "Response: " + new String(response)); + Log.d(TAG, "Response: " + new String(response)); } } diff --git a/servers/php/mysql/gpstracker-09-12-14.sql b/servers/php/mysql/gpstracker-09-12-14.sql index b7cd427..8dcc142 100644 --- a/servers/php/mysql/gpstracker-09-12-14.sql +++ b/servers/php/mysql/gpstracker-09-12-14.sql @@ -199,6 +199,7 @@ BEGIN INSERT INTO gpslocations (latitude, longitude, speed, direction, distance, gpsTime, locationMethod, phoneNumber, sessionID, accuracy, extraInfo, eventType) VALUES (_lat, _lng, _mph, _direction, _distance, _date, _locationMethod, _phoneNumber, _sessionID, _accuracy, _extraInfo, _eventType); + SELECT NOW(); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ;