com.drismo.logic
Class JsonFunctions

java.lang.Object
  extended by com.drismo.logic.JsonFunctions

public class JsonFunctions
extends java.lang.Object

Used to get the city/street name from a location. Uses 2 different webservices from www.geonames.org

See Also:
ViewTrip

Constructor Summary
JsonFunctions()
           
 
Method Summary
static java.lang.String getCity(float lat, float lon)
          Get the city from a position.
static org.json.JSONObject getJSONfromURL(java.lang.String url)
          Borrowed from: http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/ and slightly modified.
static java.lang.String getStreet(float lat, float lon)
          Gets the streetname from a position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonFunctions

public JsonFunctions()
Method Detail

getJSONfromURL

public static org.json.JSONObject getJSONfromURL(java.lang.String url)
Borrowed from: http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/ and slightly modified.

Parameters:
url - the url to get JSON data from
Returns:
the JSONObject containing all the info.

getCity

public static java.lang.String getCity(float lat,
                                       float lon)
Get the city from a position.

Parameters:
lat - the latitude
lon - longitude
Returns:
returns the City name or -- if something went wrong

getStreet

public static java.lang.String getStreet(float lat,
                                         float lon)
Gets the streetname from a position.

Parameters:
lat - the latitude
lon - longitude
Returns:
returns the street name or -- if something went wrong