If you already have the key got the link below and add the fingerprint along with your android project package name
You also need to login to your google account
https://code.google.com/apis/console
Click on create new key. Add the fingerprint along with your android project package name.
You can see the api key above
Enable google map api v2 from services tab.
Then in manifest file under application tag
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key"/>
Answer from Raghunandan on Stack OverflowIf you already have the key got the link below and add the fingerprint along with your android project package name
You also need to login to your google account
https://code.google.com/apis/console
Click on create new key. Add the fingerprint along with your android project package name.
You can see the api key above
Enable google map api v2 from services tab.
Then in manifest file under application tag
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key"/>
Visit the API Console
Login with your Google acocunt and click the API Access tab. Your API key is listed there.
You will also need to enable Google Maps Android API v2 service for your API key. You can do that on the services tab via the toggle button.
Videos
Hello, I am about to use for the first time the google map api for android,
And apparently in order to display the app in your app context, you need to have the API key defined in the android manifest like this:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY_HERE"/>Isn't there any other way?
Isn't that dangerous? People can get your api key.
I read about restricting the api to your app, but is that enough? Are there bad stories about people who had a misadventure of missused map APIs? Despite restricting?
What other solutions to protect yourself from your API key abuse?
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?
There seems no way to have google maps api key free without credit card. To test the functionality of google map you can use it while leaving the api key field "EMPTY". It will show a message saying "For Development Purpose Only". And that way you can test google map functionality without putting billing information for google map api key.
<script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap" async defer></script>
Updated Answer
As of June11, 2018 it is now mandatory to have a billing account to get API key. You can still make keyless calls to the Maps JavaScript API and Street View Static API which will return low-resolution maps that can be used for development. Enabling billing still gives you $200 free credit monthly for your projects.
This answer is no longer valid
As long as you're using a testing API key it is free to register and use. But when you move your app to commercial level you have to pay for it. When you enable billing, google gives you $200 credit free each month that means if your app's map usage is low you can still use it for free even after the billing enabled, if it exceeds the credit limit now you have to pay for it.