[GIS] Determine current address location in android mobile app

androidgoogle-maps-apilicense

In my Android App I need to figure out what address i.e city, state, country my Android phone is in.

So for that, first I determine latitude, longitude via GPS. The phone gives this.

Now, from lat, long I need to determine the address as follows (probably called reverse geocoding):
http://maps.google.com/maps/api/geocode/json?latlng="+ latLng

This works and gives me the address with city, state, country etc. All fine.
Does this break any Google licensing requirements since I am not using any maps and I only need the location address?

If so, how else can I determine the address where an Android phone is.

Best Answer

Yes, using the server-side Geocoding API without displaying the results on a Google Map violates Google's Maps API Terms-of-Service.

From Section 10.1.1(h):

No Use of Content without a Google Map. You must not use or display the Content without a corresponding Google map, unless you are explicitly permitted to do so in the Maps APIs Documentation. In any event, you must not use or display the Content on or in conjunction with a non-Google map. For example, you must not use geocodes obtained through the Service in conjunction with a non-Google map. As another example, you must not display Street View imagery alongside a non-Google map, but you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation explicitly permits you to do so.

One alternative on Android is the Android Geocoder, which doesn't have that terms-of-service restriction. The Geocoder.getFromLocation() method takes in a latitude and longitude and returns a list of possible address matches. Another benefit of the Android Geocoder is that there are no usage limits. I created a sample Android Geocoder app on Github that you can feel free to use (licensed under Apache 2.0) (an aside - I created the app originally to demo a bug on Android that's since been fixed).

There are also other alternatives. You might want to check out the OpenTripPlanner for Android app on Github that our group has worked on - we support multiple geocoders (including the MapQuest Nominatim API), as discussed in the OTPGeocoding wiki. Here's the code for the OTPGeocoding task, and the utility method that actually makes the calls.