Reputation:
Do I need a new API key for each of my projects or do you just need one that you can use multiple times in any project?
Upvotes: 1
Views: 2536
Reputation: 1856
just write down these line on cmd prompt to extract the MD5 fingerprint.
keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android
After getting MD5 fingerprint Copy the MD5 certificate fingerprint and navigate your web browser to: http://code.google.com/android/maps-api-signup.html. Follow the instructions on the page to complete the application and obtain the Google Maps key.
To use the Google Maps in your Android application, you need to modify your AndroidManifest.xml file by adding the element together with the INTERNET permission:
To display the Google Maps in your Android application, modify the main.xml file located in the res/layout folder. You shall use the element to display the Google Maps in your activity. In addition, let's use the element to position the map within the activity:
for example :
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ"
/>
Upvotes: 1
Reputation: 6892
Each Google Maps API key is associated with the keystore you use to sign your app. So, if you use the same keystore for signing your all apps, you can use the same Maps API key.
But I not recommend you use the same Maps API key. Because now Google Maps API is no longer total free. Each Maps API key is limited query per day. Creating different Maps API key for each app is a good way to prevent limit Google Maps query.
Upvotes: 4
Reputation: 11230
Key is tied to your MD5 fingerprint of the certificate, so each app needs a new key.
Getting a Maps API Key
MapView objects display Maps tiles downloaded from the Google Maps service. Before you can use Google Maps data, you must register with the Maps service, agreeing to the Terms of Service and supplying an MD5 fingerprint of the certificate(s) that you will use to sign your application. For each registered certificate fingerprint, the service provides you with a Maps API Key — an alphanumeric string that uniquely identifies you and your certificate. You then store your API Key in your MapView objects, so that when they request Maps data, the server can determine that you are registered with the service.
Upvotes: 1