12/17/2020 Generate Map Api Key Android
Note: As shown above, com.google.android.geo.APIKEY is the recommended metadata name for the API key. A key with this name can be used to authenticate to multiple Google Maps-based APIs on the Android platform, including the Maps SDK for Android.
To use the Maps Embed API you must have an API key. Whatsapp download mac. The API key is a unique identifier that isused to authenticate requests associated with your project for usage and billing purposes.
Get the API key
You must have at least one API key associated with your project.
To get an API key:
Add the API key to your request
You must include an API key with every Maps Embed API request.In the following example, replace
YOUR_API_KEY withyour API key.
For more information about
MODE and parameters options in the code above, see Forming the URL for the Maps Embed API.
Restrict the API key
We strongly recommend that you restrict your API key. Restrictions provide added security and helpensure only authorized requests are made with your API key. There are two restrictions. You shouldset both:
To restrict an API key:
To use the Google Maps functionality in Android, you need toregister for a Maps API key with Google. Until you do this, you willjust see a blank grid instead of a map in your applications. You mustobtain a Google Maps Android API v2 key - keys from the older GoogleMaps Android API key v1 will not work.
Obtaining a Maps API v2 key involves the following steps:
Obtaining your Signing Key FingerprintGenerate Map Api Key Android App
Install adobe reader 10. To request a Maps API key from Google, you need to know theSHA-1 fingerprint of the keystore that is used to sign the application.Typically, this means you will have to determine the SHA-1 fingerprintfor the debug keystore, and then the SHA-1 fingerprint for the keystorethat is used to sign your application for release.
By default the keystore that is used to sign debug versions of aXamarin.Android application can be found at the following location:
C:Users[USERNAME]AppDataLocalXamarinMono for Androiddebug.keystore
Information about a keystore is obtained by running the
keytool command from the JDK. This tool is typically found in the Java bindirectory:
C:Program FilesAndroidjdkmicrosoft_dist_openjdk_[VERSION]binkeytool.exe
By default the keystore that is used to sign debug versions of aXamarin.Android application can be found at the following location:
/Users/[USERNAME]/.local/share/Xamarin/Mono for Android/debug.keystore
Information about a keystore is obtained by running the
keytool command from the JDK. This tool is typically found in the Java bindirectory:
/System/Library/Java/JavaVirtualMachines/[VERSION].jdk/Contents/Home/bin/keytool
Run keytool using the following command (using the file paths shownabove):
Debug.keystore Example
For the default debug key (which is automatically created for you fordebugging), use this command:
Production Keys
When deploying an app to Google Play, it must besigned with a private key.The
keytool will need to be run with the private key details, and theresulting SHA-1 fingerprint used to create a production Google Maps APIkey. Remember to update the AndroidManifest.xml file with thecorrect Google Maps API key before deployment.
Keytool Output
You should see something like the following output in your consolewindow:
You will use the SHA-1 fingerprint (listed after SHA1) later in this guide.
Creating an API project
After you have retrieved the SHA-1 fingerprint of the signing keystore, it is necessary to create a new project in the Google APIs console (or add the Google Maps Android API v2 service to an existing project).
At this point the API project has been created and Google Maps Android API v2 has been added to it. However, you cannot use this API in your project until you create credentials for it. The next section explains how to create an API key and white-list a Xamarin.Android application so that it is authorized to use this key.
Obtaining the API KeyGenerate Api Key
After the Google Developer Console API project has been created, it is necessary to create an Android API key. Xamarin.Android applications must have an API key before they are granted access to Android Map API v2.
Connect the project to a billable accountGenerate Api Code
Beginning June,11 2018, the API key will not work if the project is not connected to a billable account (even if the service is still free for mobile apps).
Adding the Key to Your Project
Finally, add this API key to the AndroidManifest.XML file of your Xamarin.Android app. In the following example,
YOUR_API_KEY is to be replaced with the API key generated in the previous steps:
Related LinksComments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |