如何在 Android 地图活动中显示地图?
我已将地图视图附加到我的布局中,并显示指南针和我当前的位置。 我遇到的问题是,视图中没有显示街道地图,所以基本上我只是在空白网格上看到指南针和我当前的位置。
I have attached a mapview to my layout and have a it showing a compass and my current location. 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当您通过 Eclipse 运行或调试时,您的应用程序将使用自动创建的调试密钥进行签名。 它与您在发布应用程序时签署应用程序的密钥不同。
您需要使用调试密钥获取 API 密钥。
请参阅 上的“获取 SDK 调试证书的 MD5 指纹”部分http://code.google.com/android/add-ons/google-apis/mapkey.html
准备好发布应用后,您可以将调试 API 密钥替换为您当前使用的 API 密钥。
When you run or debug through Eclipse your app is signed with your debug key which will have been automatically created. 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.
See the 'Getting the MD5 Fingerprint of the SDK Debug Certificate' section on http://code.google.com/android/add-ons/google-apis/mapkey.html
Once you are ready to release your app, you replace the debug API key with the API key you are currently using.
确保您拥有 INTERNET 权限和正确的 API 密钥。 其中任何一个都会给你空白网格效果。
http://code.google.com/android/add- ons/google-apis/mapkey.html
Make sure you have the INTERNET permission and a proper API key. Either of those will give you the blank grid effect.
http://code.google.com/android/add-ons/google-apis/mapkey.html
事实证明,仅当使用 adb install {app 的路径} 对应用程序进行签名和上传时才会显示地图,当我使用 Eclipse 运行或调试时,同一个应用程序无法工作。
Turns out the map is only shown when the app is signed and uploaded using adb install {path to app}, the same app didn't work when I run or debug using Eclipse.
查看以下内容:
1. 包括一罐地图。
2. 生成您的证书并注册。 现在应该可以了
:)
Check out the followings:
1. include jar of maps.
2. generate your certificate and register it. It should work now
:)