In my app I use the BlackBerry API to get latitude and longitude. I would like to do reverse geocoding using Google maps by creating an http connection. How do I parse the data, and then read a specific element, such as the address?
An example URL:
Gives response:
{
"name": "9.600000,76.760000",
"Status": {
"code": 200,
"request": "geocode"
},
"Placemark": [ {
"id": "p1",
"address": "Kanjirappalli Elikkulam Rd, Kerala, India",
"AddressDetails": {
"Accuracy" : 6,
"Country" : {
"AdministrativeArea" : {
"AdministrativeAreaName" : "Kerala",
"SubAdministrativeArea" : {
"SubAdministrativeAreaName" : "Kottayam",
"Thoroughfare" : {
"ThoroughfareName" : "Kanjirappalli Elikkulam Rd"
}
}
},
"CountryName" : "India",
"CountryNameCode" : "IN"
}
Use the JSON ME library. See Using JSON in Java ME for examples of how to use it.