menu_on_top
menu_on_top

Reputation: 2613

Problem on loading maps from the apk

i have created an app with maps.i have followed every step as i have found from the web,i have got the key and the app is working excellent on the emulator and i can see the maps.But as i load the singned apk to my mobile the map is not showing...:(..any idea?

Upvotes: 2

Views: 1435

Answers (2)

NickT
NickT

Reputation: 23873

Do this (assuming the that keytool is in your path):

Type

keytool -genkey -v -keystore my-release-key.keystore -alias release_alias -keyalg RSA -keysize 2048 -validity 10000

You should see the following prompts:
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  FirstName Surname
What is the name of your organizational unit?
  [Unknown]:  FirstName Surname
What is the name of your organization?
  [Unknown]:  FirstName Surname
What is the name of your City or Locality?
  [Unknown]:  YourTown
What is the name of your State or Province?
  [Unknown]:  YourTown
What is the two-letter country code for this unit?
  [Unknown]:  UK
Is CN=FirstName Surname, OU=FirstName Surname, O=FirstName Surname, L=YourTown, ST=YourTown, C=UK c
orrect?
  [no]:  yes

Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with
 a validity of 10,000 days
        for: CN=FirstName Surname, OU=FirstName Surname, O=FirstName Surname, L=YourTown, ST=Lond
on, C=UK
Enter key password for <release_alias>
        (RETURN if same as keystore password):
[Storing my-release-key.keystore]

This keystore will be in the the directory where you ran the keytool command from, in my case it was in C:\users\FirstName

Now to view the generated MD5 fingerprint, type:

keytool -list -alias release_alias -keystore c:\users\FirstName\my-release-key.keystore

You will see:

Enter keystore password:
release_alias, 08-Sep-2010, PrivateKeyEntry,
Certificate fingerprint (MD5): **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**

    (** is substituted for my private information, you should see hex values)

This is your new MD5 generated from the RELEASE key, submit this to the Google API key page and you will get back:

Thank you for signing up for an Android Maps API key!
Your key is:
1234567891bcdefg1234567891bcdefg (or whatever yours is)
This key is good for all apps signed with your certificate whose fingerprint is:
**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**

Put that key in your XML

Upvotes: 3

Alin
Alin

Reputation: 14571

You need to create a key for signing your aplication. Than for this key of yours you need to go tru all the steps, just as you did with the emulator autogenerated one.

When you sign your application from eclipse, you are asked if you want to create a key, make one and remember where you stored it.

Then go to C:\Program Files\Java\\bin" and run the following command: from a command window

keytool.exe -list -alias androiddebugkey -keystore "C:\YourCreatedKey" -storepass android -keypass android

Copy the MD5 certificate fingerprint and navigate your web browser to: http://code.google.com/android/maps-api-signup.html. Follow the instructions on the page to complete the application and obtain the Google Maps key.

Use the obtain key in your mapView control in your xml layout.

Upvotes: 1

Related Questions