开发者

How do I register a correct Google Maps Api Key?

开发者 https://www.devze.com 2023-01-03 11:32 出处:网络
I am using 2 map Activities. do i want to register multiple Map APi key for each? Now I am getting this exception:

I am using 2 map Activities. do i want to register multiple Map APi key for each? Now I am getting this exception:

06-16 18:49:41.498: INFO/MapActivity(11067): Handling network change notification:CONNECTED
06-16 18:49:41.498: ERROR/MapActivity(11067): Couldn't get connection factory client

I googled about this exception. It concludes that must be a API Key Problem? Is that true? Why it happens?

This is my code for mapview tag:

<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview_id"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:clickable="true" android:apiKey="my_api_key" />

i got this exception while creating the object for the mapview iteself. That is:

MapView mv=(MapView)findViewById(R.id.mapview_开发者_如何学运维id);


I would guess that you are using the API Key for the wrong certificate.

If you are using Eclipse and just click on run on emulator Eclipse will sign your program with a debug certificate and run it. For publishing to the market you need to create your own certificate. The API Key you got from google can be used in every application that uses the certificate that you used for obtaining the key.

That means if you want to see the map in the debug environment you have to get a key with the debug certificate and before publishing the app to the market you need to change the API Key to the one obtained with your signing certificate.

Further help would need a more detailed explanation on what exactly is not working.


You can use one single key for several map activities...

Without a snippet of code I/we can't find any source of error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号