In order to use the Places API you do need a developer key, at least if you want to go over 1000 queries a day. You registered for it in the Google API Console, and you can find it again there.
Answer from Mano Marks on Stack OverflowRetrieve Google Maps API Key - Stack Overflow
google maps - Googlemaps API Key for Localhost - Stack Overflow
How to secure google map api key
Cannot find Google Maps key
Videos
In order to use the Places API you do need a developer key, at least if you want to go over 1000 queries a day. You registered for it in the Google API Console, and you can find it again there.
This appears to work for me - I 'lost' my API Key ages ago
https://developers.google.com/maps/documentation/javascript/tutorial#api_key
- Go to this address: https://console.developers.google.com/apis
- Create new project and Create Credentials (API key)
- Click on "Library"
- Click on any API that you want
- Click on "Enable"
- Click on "Credentials" > "Edit Key"
- Under "Application restrictions", select "HTTP referrers (web sites)"
- Under "Website restrictions", Click on "ADD AN ITEM"
- Type your website address (or "localhost", "127.0.0.1", "localhost:port" etc for local tests) in the text field and press ENTER to add it to the list
- SAVE and Use your key in your project
If you are working on localhost, create a separate APIkey for your development and then remove restrictions on that key so that your localhost can use it. Remember to not use this key on production, so you don't expose your key to hunters online.
I had the same issue and all attempts to get the restrictions working on my localhost environment was not successful until I created a separate apikey specifically for development and then removed its restrictions. However I don't use that key on production environment, and once am done with developments, I will delete the API key immediately.
I Know this post is late, but for people that will likely face this issue in the future, this is the best route to go.
As far as i ve checked, the api key should be in android manifest which will be used by the MapView that we are using in the app. But the problem is if i decompile my app, i can see my api key in the manifest.
I even checked the apk (cloned the repo found in android documentation website itself which has the example on implementing maps in project), its the same.
How to secure it? I saw that we can use google console and we can restrict the use of api, but still the api should be set in manifest and still it can be decompiled and misused. How to solve this?