我知道可以通过下面的代码以编程方式安装Android应用程序,该代码传递APK文件的URI。我能否在不传递APK文件URI的情况下安装应用程序?例如,获取APK文件的字节数组并安装它?
File appFile = new File("application.apk");
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType(Uri.fromFile(appFile),"application/vnd.android.package-archive");
startActivity(installIntent);
file://
URL而不是一个content://
URL。 - David Wasser