Skip to content Skip to sidebar Skip to footer

Android Mapview Different In Phone And Emulator

About App:--This is a simple app which find the user current location. Problem:-- The app works fine on emulator please see the image. But in phone it is not showing the MapView.P

Solution 1:

For testing on real hardware you need to use a key different from the debug key. Following your post you are using a debug keystore.

https://developers.google.com/maps/documentation/android-api/v1/?csw=1#getfingerprint

Read that paragraph on google.

Is important that the application is exported as a signed application with the same key used for the google api (and NOT the debug key).

For create a valid read that paragraph:

http://developer.android.com/guide/publishing/app-signing.html#releasemode

and then use the same key to obtain the google maps api key.

Once you have the key for your application you can export a signed application by clicking with right button of your mouse on the project select Android Tools and then Export as a signed application package and follow the wizard (probably you can create a new key using that wizard).

hope that help.

Solution 2:

I don't know if it's the same error of "this question", because it shows a white background with a gray grid when the tiles are loading (or they never finish to load when the API key is wrong).

Anyway you are getting the same error in log, so let's go in that direction:

As I self-answered in that question, you must have 2 API keys: one for debug uses at the emulator, and another one for real devices. This last one must be created manually. It can be done from the command prompt or with a Eclipse option.

Once you have created the API key dor real devices, you must create the APK with right-click over the project and export as a signed apk.

Everything is well explained here, and also this question has been made here before, and its solution is well described for Eclipse in accepted answer for this question.

Post a Comment for "Android Mapview Different In Phone And Emulator"