让Google Map在手机模拟器上工作

1. Create a new emulator

  • for device choose “5.1” WVGA (480 x 800: mdpi)”
  • for target choose “Android 4.1.2 – API level 16″
  • for “CPU/ABI” choose “ARM”
  • leave rest to defaults

these are the settings that are working for me. I don’t know for different ones. Comment bellow if you’ve tried some different ones.

2. Start the emulator

3. Install com.android.vending-1.apk and com.google.android.gms-1.apk via ADB install command

Google Maps should work now in your emulator. Please comment is it working for you?

update no 1: People are reporting that this does not work on targets with Google APIs already installed, try it with clean android builds.

update no 2: Relevant permissions for Google Maps API enabled app (regarding one of the questions below):

<permission android:name="com.yourpackagename.permission.MAPS_RECEIVE" android:protectionLevel="signature">

 </permission>

 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
 <uses-permission android:name="com.yourpackagename.permission.MAPS_RECEIVE"/>
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

 <uses-feature 
 android:glEsVersion="0x00020000"
 android:required="true"/>

 <meta-data
 android:name="com.google.android.maps.v2.API_KEY"
 android:value="yourAPIkeyHERE" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值