In my application I need to use the geocoding, but I am not quite clear which method to use. Until yesterday I added the parameters to the URL maps.googleapis.com/maps/api/geocode/json?address=myparameter&sensor=false
, but Google blocked my requests for a day, making the application crash because it did not return any results from the request for geocoding.
Now I am using the Geocoder
class that does the same thing and also I have seen that you can create and use an API key for Geocoding.
Which method do you recommend to use? What is the difference between the two methods, apart from the limitations of the requests?
Users of free API have following limits:
You can include API key in web-request also like:
Not sure about android Geocoder class, maybe someone else can help you out in that matter. But i assume same limits would apply.
If you need to use a map in your app, you should use the API called: Google Maps Android API v2.
If you need to manage geocoded data (address to lat/lng or viceversa) then enable Geocoding API and start using the class Geocoder.
For example (lat/lng to address):