Created
June 11, 2014 21:20
-
-
Save Casperhr/85c1f9c50f6507eb0bbd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NJSONObject records = json.optNJSONObject("Records"); | |
| //Check if null | |
| NJSONObject record = records.getNJSONObject("Record"); | |
| //Check if null | |
| NJSONObject tracking = record.optNJSONObject("Tracking"); | |
| //Check if null | |
| String gpsPosition = tracking.optString("GPSPosition",null); | |
| if(gpsPosition != null){ | |
| String[] gpsPositionArray = gpsPosition.split(","); | |
| double lat = Double.parseDouble(gpsPositionArray[0]); | |
| double lng = Double.parseDouble(gpsPositionArray[1]); | |
| //Save a latlng object on user | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment