开发者

android mapview loading

开发者 https://www.devze.com 2023-04-10 11:37 出处:网络
I am making an android app in which i am using mapviews. they are working perfectly on the device when installed from the pc.but when the same build is installed in device through android market, the

I am making an android app in which i am using mapviews. they are working perfectly on the device when installed from the pc.but when the same build is installed in device through android market, the maps does not load. following is the logcat output.

10-03 15:54:51.784: WARN/System.err(12994): java.io.IOException: Server returned: 3
10-03 15:54:51.784: WARN/System.err(12994):     at android_maps_conflict_avoidance.com开发者_运维知识库.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
10-03 15:54:51.784: WARN/System.err(12994):     at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
10-03 15:54:51.784: WARN/System.err(12994):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
10-03 15:54:51.784: WARN/System.err(12994):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
10-03 15:54:51.784: WARN/System.err(12994):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
10-03 15:54:51.784: WARN/System.err(12994):     at java.lang.Thread.run(Thread.java:1019)

what could be the problem can anyone please help me over ths?? thanks


You can't use debug.keystore to create a Google Maps API key for applications going into the market. If you already have the application (or indeed any application) in the market then you already have the keystore you should use. This is how you use this keystore to get a Google Maps API key:

Step 1: At the command line navigate to the directory with your keystore file in it:

cd <keystore-dir>

Step 2: Now list the contents of your keystore:

keytool -list -keystore <your-keystore-file>

Step 3: Enter the password for your keystore when prompted. Keytool will now display a list of certificates and their MD5s.

Step 4: Copy the MD5 for the certificate you are going to use to sign your application into your copy/paste buffer.

Step 5: Open a browser and navigate to http://code.google.com/android/maps-api-signup.html - if you're not logged in with your Android Market account, you'll need to do that next, before you generate your API key.

Step 6: Paste the MD5 from your copy/paste buffer into the text box labelled "My certificate's MD5 fingerprint:" and tick the "I have read and agreed..." box.

Step 7: Click 'Generate API Key'. You'll now see the API key you need to use.

Step 8: Copy and paste the API key into your MapView component's android:apiKey property.

If you have multiple MapView components then you can declare a string resource:

<string name="production_api_key">thisIsMyKeyValue</string>

Now you can use this in your android:apiKey property in the same way that you reference any other string value:

android:apiKey="@string/production_api_key"

Now export the application to an APK file using the certificate you used in step 4.

Provided you follow this step-by-step guide you should be OK - I've just myself started using a maps API key generated in this way.

Things to watch out for:

  • Using the MD5 of the keystore file (md5 <my-keystore-file>), not of the certificate. Its the MD5 of the certificate you need.

  • Being logged in to Google when you generate the API key, but with the wrong account. Your maps API key and your Android Market signing key must belong to the same Google account.

0

精彩评论

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