android 在代码中安装apk的方法
2012-09-01 16:20
483 查看
第一步:保存apk文件到sdcard或者其他地方
第二步:修改apk文件的权限为可执行 ,例如chmod ‘777’ file:
第三步:使用Intent 调用安装:
第二步:修改apk文件的权限为可执行 ,例如chmod ‘777’ file:
String command = "chmod " + permission + " " + path; Runtime runtime = Runtime.getRuntime(); runtime.exec(command);
第三步:使用Intent 调用安装:
Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setDataAndType(Uri.parse("file://" + path),"application/vnd.android.package-archive"); context.startActivity(intent);
相关文章推荐
- Android实现用代码简单安装和卸载APK的方法
- Android apk安装的几种方法
- [Android]实现静默安装APK的两种方法
- android应用后台安装,静默安装的代码实现方法
- android adb push 与 adb install的比较(两种安装APK的方法)
- [Android]实现静默安装APK的两种方法
- ANDROID代码实现APK文件的安装与卸载
- android静默安装、静默卸载apk方法
- ANDROID代码实现APK文件的安装与卸载
- Android中代码运行指定Apk的简单方法
- android自动安装apk代码实例(不使用apk安装器安装)
- android adb push 与 adb install 区别(两种安装APK的方法)
- Android 代码监控apk安装,卸载,替换
- android adb push 与 adb install 差异(两种安装APK的方法)
- android apk应用程序如何用代码实现 自己安装自己(自升级)?
- Android代码实现APK文件的安装与卸载
- Android APK安装与卸载的代码实现
- Android 代码监控apk安装,卸载,替换
- Android常用代码之普通及系统权限静默安装APK
- 【摘录】Android实现静默安装APK的两种方法