Install APK in Background
证书folderSee中存在上述git链接中的google-certificate.keystore
步骤1:我在模拟器中运行代码它工作得很好[但我需要将google-certificate.keystore位置放在自定义调试键区中,该键区出现在Eclipse -> Preference -> Android -> bulit中
步骤2:如果我没有放入它给出的java.lang.reflect.InvocationTargetException的位置
如果我连接开发人员电缆并将其运行到Android设备
如果我按照步骤1操作,它会在控制台窗口中显示Installation error: INSTALL_FAILED_INVALID_INSTALL_LOCATION
如果我遵循步骤2,它会安装在设备中,但会给出相同的异常
编辑:
Signed APK Guide
下面是创建apk文件步骤,但我不知道应该在哪里输入命令
编辑:添加Manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".InstallInBackgroundSample"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>发布于 2012-11-28 00:58:00
这位博主自己也在评论中写道:
嗨,伙计们,我发现了问题,不幸的是我的消息不太好。我发现这种技术只对我有效,因为我使用了模拟器的安全证书(与我的设备在我的例子中使用的证书相同)。我研究并看到有两种方法来使用隐藏的API:-将你的应用程序预先安装到ROM上的系统文件夹中-使用制造商的安全证书编译你的应用程序,所以如果你要为特定的设备制作一个应用程序,并且你有它的证书,就像我一样,这对你很有用。我很抱歉之前没有通知,但我不知道这一点。我会更新我的帖子,我会先警告你。感谢您的反馈。
如果没有手机制造商的证书或有根基的设备,你想要的就不可能了。
https://stackoverflow.com/questions/13493494
复制相似问题