开发者

google maps not loading in my android application

i have made an android application and in it , there is one scenario when the user clicks on an address and that address shows up on google maps. Now when i tested the application on the emulator, the google maps did load properly, but now that i am trying the same on my htc desire z, the maps is not loading. Although the maps application which came built-in in my phone is l开发者_运维知识库oading google maps correctly. what could be the problem? why is my application not able to load the map view?

thank you in advance. EDIT: i have obtained a google map api key and have included it in the mapview that i am using.i have added overlays and etc. It is all showing fine on the emulator , but on my device it is not showing any maps. The overlays are visible.


There is a difference between a debug maps API key and a release maps API key. With the first it will only run on the emulator.

Unless you have visited the Google site twice (once to get a key which matches the debug keystore and once to get a key which matches your release keystore) then you haven't got a release key and your app won't run on real device.


Our Android developers were also facing this problem. We solved the problem like this:

  1. We generated API keys from each machine and added the Key to their respective main.xml file. So each developer had a separate api key.

  2. We started the emulator from the command line using the android "emulator" command which is located in the tools directory and started with the proxy option instead of starting it from eclipse, eg :

E:>emulator -avd New_Device -http-proxy http://202.0.0.203:808


Most probably, you didn't register your application into the system. This is the link.

http://code.google.com/android/add-ons/google-apis/maps-api-signup.html

If this is not the case, please provide the error details from Logcat.


You need to get an API key from Google.

Here is a good article that explain how to obtain API key.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜