真机缺少com.google.android.maps.jar解决方法

真机缺少com.google.android.maps.jar解决方法:

  
原文:http://kb.cnblogs.com/a/1652230

写了个基于google map
api的应用,模拟器一直都顺利,移植到真机时由于真机没有com.google.android.maps.jar包一直运行不了,直到搜到此贴。
重点在这部分:

手机终端需要支持Google Add-ons

 

作为与Google合作的手机终端的制造商,如果想在自己的Android终端中集成Google的一些应用,例如mapmarketpicasasync等,需要和Google签约,这样Google会有专人帮你将这一系列服务整合到你的平台中来。

 

作为没有和Google合作的手机终端的制造商,我们可以使用破解的方法将Add-ons中的运行库整合到自己的framework中来(build到手机终端的system.img中)。操作如下:

 

1. Android中,额外支持Google Add-ons(GoogleMaps),需要将如下档案(从标准的SDKpull出来的,也可以从GPhonepull出来)打包进System.imgGoogle Add-ons只需要1--2GoolgeMaps(Google的地图程序) 需要1--5

1)system/framework      com.google.android.maps.jar

2)system/etc/permissions com.google.android.maps.xml

3)system/framework      com.google.android.gtalkservice.jar

4)system/etc/permissions com.google.android.gtalkservice.xml

5)system/app        Maps.apk (Google Maps v3.0)

 

2.源码:Android CupcakeRelease(经测试,在donut平台同样适用。)

1)编译源码(为了生成out/target目录中Android最原始的东西)

2)将以上文件加入out/target/product/generic相应目录,在源码根目录使用makesnod打包,获得新的system.img


因此,做如下操作把模拟器里的上面所述1-3个文件pull出来:

adb pull/system/framework/com.google.android.maps.jarF:\fatcat\adbshell\com.google.android.maps.jar
adb pull /system/etc/permissions/com.google.android.maps.xmlF:\fatcat\adbshell\com.google.android.maps.xml
adb pull system/app/Maps.apk F:\fatcat\adbshell\Maps.apk



然后usb连上你的真机,把pull出来的3个文件push进去:

adb pushF:\fatcat\adbshell\com.google.android.maps.jar/system/framework/
adb push F:\fatcat\adbshell\com.google.android.maps.xml/system/etc/permissions/
adb push F:\fatcat\adbshell\Maps.apk /system/app/


这些操作的前提是取得设备的root权限,本人在操作乐1时失败:

C:\Users\Administrator>adb pushF:\fatcat\adbshell\com.google.android.maps.jar /
system/framework/
failed to copy 'F:\fatcat\adbshell\com.google.android.maps.jar' to'/system/fram
ework//com.google.android.maps.jar': Permission denied


目前正想法解决乐1root问题!



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
package com.MangoMap; //import android.app.Activity; import com.google.android.maps.MapActivity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.view.View; import android.widget.ListView; import android.widget.SimpleAdapter; import java.text.Collator; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; //MapView Com import com.google.android.maps.MapView; import com.google.android.maps.MapController; import com.google.android.maps.GeoPoint; //import com.google.android.maps. public class MangoMap extends MapActivity { /** Called when the activity is first created. */ private MapView mpv; private MapController mpc; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //地图 mpv = (MapView) findViewById(R.id.map); mpv.setTraffic(true); mpv.setClickable(true); mpv.setScrollContainer(true); mpc = mpv.getController(); GeoPoint gp = new GeoPoint((int) (23.05320 * 1000000), (int) (113.155550 * 1000000)); //地理坐标 mpc.animateTo(gp); mpc.setZoom(15); //mpc. // } @Override protected boolean isRouteDisplayed() { return false; } } //----------------- <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> --> <com.google.android.maps.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey="YOUR API key" /> <Button android:text="@+id/Button01" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout> //--------------------- <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.MangoMap" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <uses-library android:name="com.google.android.maps" /> <activity android:name=".MangoMap" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="3" /> </manifest>
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值