Create an Android-restricted API key for your project. Copy the resulting API key, go back to Android Studio, and paste the API key into the element in the googlemapsapi.xml file. A slightly less fast way: Use the credentials provided in the googlemapsapi.xml. The Google Maps API provides you the ability to add Google Maps to your application. The Google Maps API automatically deals with the Google Maps server, data downloading, map display and touch gesture on the map. Using this API you can also add markers to the Google Maps. The Google Maps Android API provides a MapView class.
If you want to use Google Maps in your Xamarin.Android app, you will need to obtain an API key. It’s easy to generate an API Key, but we will also want to restrict it’s usage, so that only your app can use it. This alleviates the security concern of placing the API Key in your app, and someone taking it for their own use.
Create Google Maps API Key
Google Map Api Key Android
- Go to the Google Developers Console
- Click Create Project (If you don’t already have one, otherwise it defaults to an existing project). If you have an existing project, but want to create a new one, click the drop down, then the + button.
- Click ENABLE APIS AND SERVICES
- Click Google Maps Android API
- Then click enable
- Click Credentials, in the Menu, then click Create credentials and select API key
This is your API key that you can use in your Android app.
In your AndroidManifest.xml file, inside the application tag, place your API Key.
Restrict Key Access
This API Key is now available, but can be used with anyone who has access to it. If you are using it Server side, then the security issues aren’t too great. However, if you need to distribute this with your app, then it is best to restrict this, so only your app can use it.
Generate Fingerprint
We first need to generate a fingerprint. This is done via the command or terminal line. And is in this format.
For windows, you will find the debug values for your keystore here, and the default path for the Java SDK. You will need to go to this path, in the commandline to run the keytool.
- [STORE FILENAME] = C:Users[USERNAME]AppDataLocalXamarinMono for Androiddebug.keystore
- C:Program Files (x86)Javajdk[VERSIONNUMBER]bin
For a Mac, they will be as follows.
Generate Api Key Google Maps Android Free
- [STORE FILENAME] = /Users/[USERNAME]/.local/share/Xamarin/Mono for Android/debug.keystore
- /System/Library/Java/JavaVirtualMachines/[VERSIONNUMBER].jdk/Contents/Home/bin/keytool
The debug values you will also want are
- [ALIAS NAME] = androiddebugkey
- [STORE PASSWORD] = android
- [KEY PASSWORD] = android
Here is an example, for myself in Windows.
The example output, you will get is.
What you want is the SHA-1 signature.
Add App Restriction
Now, lets go back to the developer console.
- Edit the API Key.
- Add the fingerprint, and your Xamarin.Android apps package name, and save.
Total commander 9.21 key generator. God of war 4 pc key generator. Please note, that this has shown you how to do it, for a debug version. Create a new Fingerprint, against your production Keystore, before you deploy this to the PlayStore.