1

I recently made an Android application using eclipse. It is working perfectly in my emulator.

But when I export my application using the Export Wizard on Eclipse it made outputs of .apk and certificate files, I copied it to my Android phone, but the map doesn't show, it only shows gray tiles.

It has a function of displaying a Toast with current Latitude and Longitude. It's displaying on my emulator, but not in my phone.

It also displays a Toast that checks if the device's GPS is active. It works both on my emulator and phone.

I don't know what's the problem of my application. Can anyone help me?

JetPro
  • 1,044
  • 3
  • 23
  • 43

2 Answers2

1

Probably the problem lays in different Maps API keys for different certificates. Remember, a Maps API key is based on a certificate, means you should have one based on your debug certificate - you'll use it for debugging, and one based on the release certificate. If you'll try to run the version of your application signed with the debug certificate on your device it should probably work. Hope this helps.

Egor
  • 39,695
  • 10
  • 113
  • 130
  • Ok. But how will I get the "release certificate", sir? Will it also give me an MD5 code and I'll sign it to Google, then I'll change my API key on my main.xml? Thanks a lot. – JetPro Jul 10 '12 at 14:14
  • 1
    @JetPro, Yes, that's the way to do it. You'll see a complete process description on Google Maps API site. – Egor Jul 10 '12 at 14:18
  • I have another problem, the map shows on my phone, but its not getting the GPS coordinates. Do you have any idea regarding this error? – JetPro Jul 11 '12 at 02:22
  • @JetPro, There may be many things that can cause this, it's hard to answer right away. Check your code once again, maybe you've made a mistake somewhere. – Egor Jul 11 '12 at 06:51
  • Please see my code here. http://stackoverflow.com/questions/11424662/retrieving-gps-coordinates-not-working-when-ran-on-a-real-android-phone/ I am hoping that you can help me. – JetPro Jul 11 '12 at 09:57
0

You are using a key intended for debug purposes only at the emulator: you need to ask Google for a unique key for your apps, and use it in order to use maps at your devices.

Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207