Thanuka Piyasena
Thanuka Piyasena

Reputation: 11

How to use Google Geolocation API for Android app with restricted API key

How to use Google Geolocation API for Android app with restricted API key? As far as I know that we couldn't use restricted API key with the following API request since it is relevant to a web request.

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:ZIP_CODE&key=YOUR_API_KEY_RESTRICTED_TO_YOUR_ANDROID_APP

I know that we can use inbuild Geocoder class in Android to get the reverse geolocation for given postal code. But I want to know that how we can achieve reverse geocoding with Google Geolocation API with the above format.

Upvotes: 1

Views: 494

Answers (1)

betofarina
betofarina

Reputation: 1094

You can use the Java Client for Google Maps Web Services provided by Google here:

https://developers.google.com/maps/web-services/client-library

With this you should be able to use the Geocoding API Web Service and do request in that format.

Upvotes: 1

Related Questions