加入谷歌地图API V2的单声道为Android
谷歌地图API V2为Android发布了12月3日。
Google Maps API v2 for Android released on 3th December.
是否有可能将其添加到单声道为Android?
Is there any possibility to add it into Mono for Android?
我试图通过TheNextman建议指导,但不能让它工作,所以几个小时后,我设法使它工作使用以下步骤:
I tried the guide suggested by TheNextman, but wasn't able to make it work, so after several hours I managed to make it work using the following steps:
-
下载从 Xamarin的Github上页。
打开monodroid样本\ MapsAndLocationDemo_v2 \ MapsAndLocationDemo.sln上MonoDevelop的
Open monodroid-samples\MapsAndLocationDemo_v2\MapsAndLocationDemo.sln on MonoDevelop
打开Android的SDK管理器和下载的附加部分谷歌播放服务
Open the Android SDK Manager and download "Google Play Services" from the Extras section
复制\演员\谷歌\ google_play_services \ libproject \谷歌播放services_lib到monodroid样本\ MapsAndLocationDemo_v2 \
Copy \extras\google\google_play_services\libproject\google-play-services_lib to monodroid-samples\MapsAndLocationDemo_v2\
打开命令提示符和CD到monodroid样本\ MapsAndLocationDemo_v2 \谷歌播放services_lib
Open a command prompt and cd to monodroid-samples\MapsAndLocationDemo_v2\google-play-services_lib
键入以下两条命令:
Android的更新项目-p。
android update project -p .
蚂蚁调试
现在在MonoDevelop中添加文件谷歌播放-services_lib / project.properties到GooglePlayServices项目作为链接文件
Now on MonoDevelop Add the file google-play-services_lib/project.properties to the GooglePlayServices project as a linked file
现在创建一个谷歌地图API密钥。有两件事情要记住,虽然:
Now create a Google Maps API key . Two things to keep in mind though:
使用MonoDroid当调试密钥库的默认位置是:
The default location of the debug keystore when using MonoDroid is :
的Windows Vista / Windows 7中/ Windows 8中:C:\用户[用户名] \应用程序数据\本地\ Xamarin \单声道为Android \ debug.keystore OSX:/Users/[USERNAME]/.local/share/Xamarin/Mono为Android / debug.keystore
Windows Vista / Windows 7 / Windows 8: C:\Users[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore OSX : /Users/[USERNAME]/.local/share/Xamarin/Mono for Android/debug.keystore
您可以在该清单标签MapsAndLocationDemo /属性/ AndroidManifest.xml文件查找软件包名称。
You can find the package name on the MapsAndLocationDemo/Properties/AndroidManifest.xml file in the manifest tag.
如果您deplyoing到一个真实的设备则是所有,如果要部署在模拟器上继续阅读
If you are deplyoing to a real device then that is all, if you are deploying on the emulator keep reading
创建一个新的AVD在此设置: 平台:4.1.2 CPU:ARM 保留默认选项参数的其余部分
Create a new AVD with this setup: Platform: 4.1.2 CPU: ARM Leave the default options for the rest of parameters
抢vending.apk(com.android.vending.apk),并从实际设备的gms.apk(com.google.android.gms.apk)(看这篇文章的末尾更多详情)
Grab the vending.apk (com.android.vending.apk) and the gms.apk ( com.google.android.gms.apk) from a real device (Look at the end of this post for more details)
启动刚创建的仿真器,然后打开命令提示符,cd到你下载的APK文件夹
Start the emulator you just created and then open a command prompt and cd to the folder where you downloaded the APKs
类型:
亚行-e安装vending.apk 亚行-e安装gms.apk
adb -e install vending.apk adb -e install gms.apk
享受!
来源:
(1)https://github.com/xamarin/monodroid-samples/tree/master/MapsAndLocationDemo_v2
(2)This应用程序将无法运行,除非您更新谷歌播放服务。 (通过集市) 检查danbrough的评论。如果可能的话抽取两个的APK com.android.vending和com.google.android.gms从植根设备来获取库的更新版本。
(2) This app won't run unless you update Google Play Services. (via Bazaar) Check danbrough's comment. If possible extract the two APKs com.android.vending and com.google.android.gms from a rooted Device to get an updated version of the library.