Question

do i have to publish the apk everytime in order for the map to show? My map won't display while running via eclipse, i have to export to apk and then install on my deivce to test. Is there a easier way to test a map v2 apk? Thank you!

Was it helpful?

Solution

First thing you have to Use your debug.keystore file from .android folder and then generate SHA1 using that keystore.... in Command Propmt.

And then you have to generate your Google Map v2 API key using this SHA-1 from Google API Console.

And use this key in your application and you don't need to Export your Signed application..

Thanks..!!

OTHER TIPS

You can't display maps in the Emulator since it doesn't have Maps installed in it. You must run all the Maps related applications in your android device.

Also, Just connect your device to the PC/laptop and eclipse will automatically prompt in which device you want to run and then you can select your device.

Its because there is no maps in your emulator. Your map will display only on a pure AVD, i.e. it CPU of emulator must be ARM, and the target should be a Google APIs device. For Maps V2, you need google play services installed in your emulator/device. By default its not available in any emulators.

You can force install google play services into an emulator, follow this for a start.

The better option is to use a device(mobile/tab) via USB with developer options enabled (USB Debugging checked).

Try it...

Use this command to generate SHA1 certificate with your debug.keystore, than generate API key with generated SHA1 certificate How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?

After generating key from API console use that key to your Manifest file.

There is, but you need to modify your debug key in eclipse (I'm assuming you are using eclipse).

First off, The google mapview stuff only shows when the Api key you are using is derived from the signing key. Here lies the problem - eclipse uses its own default key when you're launching from the IDE.

So you need to use your actual signing key for the debug. If you go to Window -> Preferences -> Android -> Build, you will see that eclipse is using a default debug keystore.

You have there the option to use a custom debug keystore. BUT NO WAY TO SET CUSTOM PASSWORD. Good thing you can change the password on your original signing key (I prefer to create a copy and tag that as my "debug" key) and still retain all/most of its properties, I honestly don't know which ones, such that you can now use it as a debug keystore and still have it display the google maps layout.

To change keystore password just fire up cmd and do:

keytool -storepasswd -keystore my.keystore

Eclipse uses "android" as the default password for debugging, that's what you enter as new password. After modifying your key, you can now set it as the custom debug keystore and start going Ctrl+F11 on your android source.

As far as I know, you can even override installation of the normally-signed app on your phone with this technique, so it goes further than just having google maps enabled while debugging.

C:\Program Files\Java\jdk1.7.0_03\bin> keytool.exe -V -list -alias androiddebugk ey -keystore "C:\Users\Dell.android\debug.keystore" -storepass android -keypass android

type this in CMD.this will give both sha-1 and md5 key..plz change path as per ur machine..!

Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top