質問

Hi At that time working on google map. I want to display map in my activity. I successfully display the map view. But i cant show the map i think i have wrong api key so how can i get api key of google map. I create the keystore and all procedure but i didn't have idea how to get api key from this keystore.

I also give the all permission in manifest file and also add the google map library than also i cant show the map.in activity also extends mapactivity and also write code fro map in xml.

If anyone knows about that please tell me.

役に立ちましたか?

解決

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

enter image description here

Click on create new key. Add the fingerprint along with your android project package name.

enter image description here

You can see the api key above

Enable google map api v2 from services tab.

enter image description here

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.

developer link

https://developers.google.com/maps/documentation/android/v1/mapkey

write below code in cmd and you get mdfi key then it will paste on google site

$ keytool -list -alias androiddebugkey \
-keystore <path_to_debug_keystore>.keystore \
-storepass android -keypass android

other link is below

http://docs.xamarin.com/guides/android/platform_features/maps_and_location/obtaining_a_google_maps_api_key

I faced the same problem and my issue was I used debug certificate not release certificate

if you use this for release certificate "not debug certificate":

Enter the following at a terminal or command prompt:

keytool -list -v -keystore your_keystore_name -alias your_alias_name

in your_keystore_name write the path for the file you used for signed api which its extension .jks

take the sha1 which you will get in the output and used it to get the key.

https://developers.google.com/maps/documentation/android-api/signup#display_your_apps_certificate_information

serverAddress = new URL("http://maps.google.com/maps/geo?q="
                    + Double.toString(loc.getLatitude()) + ","
                    + Double.toString(loc.getLongitude())
                    + "&output=xml&oe=utf8&sensor=true&key="
                    + R.string.GOOGLE_MAPS_API_KEY);

Where GOOGLE_MAPS_API_KEYS is a string in string.xml containing your maps api key

You are trying to use google map of api v1 which is already deprecated as stated here so you can't generate new api key if your existing api key is wrong.so kindly move towards google map of api v2

See http://hmkcode.com/getting-android-google-maps-v2-api-key/.

  1. Open https://cloud.google.com/console.
  2. Select a project from an upper list (if several), or create new.
  3. In left panel click on "API and services".
  4. In "Control panel" click on "Maps SDK for Android" or create new.
  5. In "Credentials" get an API key or create new.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top