Android application self-update [duplicate]

自作多情 提交于 2019-11-28 17:07:01

If the updated apk has the same package name and is signed with the same key you can just send a intent which will call a default android installer. The installed apk will be overriden.

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(new File(pathToApk));
intent.setDataAndType(uri, "application/vnd.android.package-archive");
startActivity(intent);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!