From 45107300d1de9d5164dd691cef93ba197609e68b Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 1 Sep 2014 11:13:57 -0400 Subject: [PATCH] Fixed the address search dialog, & disabled map when not in use --- .../com/TwentyCodes/android/location/ReverseGeocoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java b/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java index 5ec1bfa..8893f90 100644 --- a/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java +++ b/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java @@ -60,7 +60,7 @@ public class ReverseGeocoder { * @author ricky barrette */ public static JSONArray addressSearch(final String address) throws IOException, JSONException { - String urlStr = "http://maps.google.com/maps/geo?q=" + address + "&output=json&sensor=false"; + String urlStr = "https://maps.googleapis.com/maps/api/geocode/json?address=" + address; urlStr = urlStr.replace(' ', '+'); final StringBuffer response = new StringBuffer(); final HttpClient client = new DefaultHttpClient(); @@ -79,7 +79,7 @@ public class ReverseGeocoder { if (Debug.DEBUG) Log.d(TAG, response.toString()); - return new JSONObject(response.toString()).getJSONArray("Placemark"); + return new JSONObject(response.toString()).getJSONArray("results"); } /** @@ -115,7 +115,7 @@ public class ReverseGeocoder { JSONArray responseArray = null; try { - responseArray = new JSONObject(response.toString()).getJSONArray("Placemark"); + responseArray = new JSONObject(response.toString()).getJSONArray("results"); } catch (final JSONException e) { return location.getLatitude() + ", " + location.getLongitude() + " +/- " + location.getAccuracy() + "m"; }