简体   繁体   English

如何在Android mapactivity中显示地图?

[英]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.

相关问题 Android MapActivity上的地图移动 - Android MapActivity on map movement MapActivity中的Android Google Map缓存 - Android Google Map caching in MapActivity 如何在Android API 9级以上的MapActivity中显示兼容性操作栏? - How to show compatibility action bar in MapActivity in android api level 9+? Android:如何在不使用xml的情况下显示我在MapActivity上的自定义视图? - Android: How to show my custom view over my MapActivity without xml? 如何在Android应用程序中将Activity移至mapActivity - How to move Activity to mapActivity in android application 如何从 Android 中的普通 Activity 启动 MapActivity - How to start a MapActivity from normal Activity in Android 如何调用Android mapActivity OnTouchEvent和LocationManager / Geopoint - how to call Android mapActivity OnTouchEvent and LocationManager/Geopoint Android:如何将菜单项添加到ActionBarSherlock MapActivity - Android: How to add menu items to a ActionBarSherlock MapActivity 如何在Android应用程序中将Activity移至mapActivity - How to move Activity to mapActivity in android application 将地址的ArrayList传递到MapActivity以在地图中显示多个位置(android) - Passing an ArrayList of address into MapActivity to Display Multiple location into map (android)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM