diff options
Diffstat (limited to 'src/org/traccar/WebDataHandler.java')
-rw-r--r-- | src/org/traccar/WebDataHandler.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java index 5e3626022..5f12b9c93 100644 --- a/src/org/traccar/WebDataHandler.java +++ b/src/org/traccar/WebDataHandler.java @@ -15,7 +15,6 @@ */ package org.traccar; -import com.ning.http.client.AsyncHttpClient; import java.util.Calendar; import java.util.Formatter; import java.util.Locale; @@ -62,16 +61,16 @@ public class WebDataHandler extends BaseDataHandler { Device device = Context.getIdentityManager().getDeviceById(position.getDeviceId()); - String request = url. - replace("{uniqueId}", device.getUniqueId()). - replace("{deviceId}", String.valueOf(device.getId())). - replace("{fixTime}", String.valueOf(position.getFixTime().getTime())). - replace("{latitude}", String.valueOf(position.getLatitude())). - replace("{longitude}", String.valueOf(position.getLongitude())). - replace("{gprmc}", formatSentence(position)); + String request = url + .replace("{uniqueId}", device.getUniqueId()) + .replace("{deviceId}", String.valueOf(device.getId())) + .replace("{fixTime}", String.valueOf(position.getFixTime().getTime())) + .replace("{latitude}", String.valueOf(position.getLatitude())) + .replace("{longitude}", String.valueOf(position.getLongitude())) + .replace("{gprmc}", formatSentence(position)) + .replace("{statusCode}", position.getSpeed() < 1.0 ? "0xF020" : "0xF11C"); - AsyncHttpClient asyncHttpClient = new AsyncHttpClient(); - asyncHttpClient.prepareGet(request).execute(); + Context.getAsyncHttpClient().prepareGet(request).execute(); return position; } |