How to get google map apikey in android

后端 未结 7 1695
轮回少年
轮回少年 2020-12-05 05:53

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 h

相关标签:
7条回答
  • 2020-12-05 06:25

    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
    
    0 讨论(0)
  • 2020-12-05 06:33

    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.
    0 讨论(0)
  • 2020-12-05 06:38
    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

    0 讨论(0)
  • 2020-12-05 06:39

    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"/>
    
    0 讨论(0)
  • 2020-12-05 06:40

    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.

    0 讨论(0)
  • 2020-12-05 06:43

    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

    0 讨论(0)
提交回复
热议问题