如何在没有市场而非系统应用的情况下在 android 上自动安装 apk [英] How can I auto install apk on android without market NOT system app

查看:29
本文介绍了如何在没有市场而非系统应用的情况下在 android 上自动安装 apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器中获得了 apk.

I get apk in server.

我试试

File apkFile = new File("/sdcard/Download/openapk.apk");
Uri apkUri = Uri.fromFile(apkFile);
Intent webIntent = new Intent(Intent.ACTION_VIEW);
webIntent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
webIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(webIntent);

这个代码.在图片下方显示后.此代码是当我单击安装按钮时.开始安装.但我想自动安装 .and apk 执行

this code. after showing under picture. this code is when I click install button. start install. but I want auto install .and apk execution

也许可以在 apk 执行后自动安装.?

perhaps possible auto install after apk execution. ?

推荐答案

不,不可能,而且它非常好,因为如果可能,这意味着应用程序可以在设备上安装任何东西而无需询问用户...

Nope, not possible and it is pretty good because if it was possible, it would mean that an app could install anything on the device without asking the user...

Android 会更加不安全.

Android would be then even more insecure.

这篇关于如何在没有市场而非系统应用的情况下在 android 上自动安装 apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆