mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-24 21:13:50 +00:00
Replaced hard coded strings with constants from FlatSmartphoneUuidAndGPSFixMovingJsonSerializer
This commit is contained in:
1 parent
3c555c8dbb
commit
c60759fdb7
1 file changed
+8
-7
+8
-7
@@ -26,6 +26,7 @@ import com.sap.sailing.android.tracking.app.R;
|
|||||||
import com.sap.sailing.android.tracking.app.utils.AppPreferences;
|
import com.sap.sailing.android.tracking.app.utils.AppPreferences;
|
||||||
import com.sap.sailing.android.tracking.app.utils.DatabaseHelper;
|
import com.sap.sailing.android.tracking.app.utils.DatabaseHelper;
|
||||||
import com.sap.sailing.android.tracking.app.valueobjects.EventInfo;
|
import com.sap.sailing.android.tracking.app.valueobjects.EventInfo;
|
||||||
|
import com.sap.sailing.domain.common.tracking.FlatSmartphoneUuidAndGPSFixMovingJsonSerializer;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@@ -191,16 +192,16 @@ public class TrackingService extends Service implements GoogleApiClient.Connecti
|
|||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
JSONObject fixJson = new JSONObject();
|
JSONObject fixJson = new JSONObject();
|
||||||
|
|
||||||
fixJson.put("course", location.getBearing());
|
fixJson.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.BEARING_DEG, location.getBearing());
|
||||||
fixJson.put("timestamp", location.getTime());
|
fixJson.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.TIME_MILLIS, location.getTime());
|
||||||
fixJson.put("speed", location.getSpeed());
|
fixJson.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.SPEED_M_PER_S, location.getSpeed());
|
||||||
fixJson.put("longitude", location.getLongitude());
|
fixJson.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.LON_DEG, location.getLongitude());
|
||||||
fixJson.put("latitude", location.getLatitude());
|
fixJson.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.LAT_DEG, location.getLatitude());
|
||||||
|
|
||||||
jsonArray.put(fixJson);
|
jsonArray.put(fixJson);
|
||||||
|
|
||||||
json.put("fixes", jsonArray);
|
json.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.FIXES, jsonArray);
|
||||||
json.put("deviceUuid", prefs.getDeviceIdentifier());
|
json.put(FlatSmartphoneUuidAndGPSFixMovingJsonSerializer.DEVICE_UUID, prefs.getDeviceIdentifier());
|
||||||
|
|
||||||
String postUrlStr = event.server + prefs.getServerGpsFixesPostPath();
|
String postUrlStr = event.server + prefs.getServerGpsFixesPostPath();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user