[英]How to show a map in an Android mapactivity?
I have attached a mapview to my layout and have a it showing a compass and my current location. 我已将mapview附加到我的布局上,并显示一个指南针和我当前的位置。 The problem I have is, that there is no street map shown in the view, so basically I just see the compass and my current location over a blank grid.
我遇到的问题是,视图中没有显示街道地图,所以基本上我只是看到指南针和我当前在空白网格上的位置。
When you run or debug through Eclipse your app is signed with your debug key which will have been automatically created. 当您通过Eclipse运行或调试时,您的应用程序将使用您的调试密钥进行签名,该调试密钥将自动创建。 It is not the same as the key you sign your app with when releasing it.
它与您在发布应用时签署的密钥不同。
You need to get an API key using your debug key. 您需要使用调试密钥获取API密钥。
See the 'Getting the MD5 Fingerprint of the SDK Debug Certificate' section on http://code.google.com/android/add-ons/google-apis/mapkey.html 请参阅http://code.google.com/android/add-ons/google-apis/mapkey.html上的“获取SDK调试证书的MD5指纹”部分。
Once you are ready to release your app, you replace the debug API key with the API key you are currently using. 准备好发布应用程序后,将调试API密钥替换为当前使用的API密钥。
Make sure you have the INTERNET permission and a proper API key. 确保您拥有INTERNET权限和正确的API密钥。 Either of those will give you the blank grid effect.
其中任何一个都会给你空白的网格效果。
http://code.google.com/android/add-ons/google-apis/mapkey.html http://code.google.com/android/add-ons/google-apis/mapkey.html
只有在使用adb install {path to app}对应用程序进行签名和上传时才会显示地图,当我使用Eclipse运行或调试时,相同的应用程序无效。
Check out the followings: 1. include jar of maps. 请查看以下内容:1。包括地图。 2. generate your certificate and register it.
2.生成证书并注册。 It should work now :)
它现在应该工作:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.