更新APK编程(无根) [英] update apk programmatically (without root)
本文介绍了更新APK编程(无根)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以编程方式更新我的Android应用程序。
I want to update my android application programmatically.
我用下面的code:
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new
File(Environment.getExternalStorageDirectory()+"/AndroidTest.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
这code显示对话框来安装应用程序。
This code display dialogue box to install application.
我要自动安装APK。
请帮助我。
推荐答案
幸运的是,这是不可能的,因为显而易见的安全原因。无需用户干预的应用不能安装应用程序,与相应的权限和某些系统应用的例外等。
Fortunately, this is not possible, for obvious security reasons. Apps cannot install apps without user intervention, with the exception of certain system apps that have the right permissions and such.
这篇关于更新APK编程(无根)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文