问题描述
我要通过这个应用程序,我发送URL下载apk文件file.now我已经使用这个网址在我的Android模拟器浏览器下载.apk文件,并自动安装一个Java Web应用程序。
所以,任何人都可以,请给我解决这个问题?
I have one java Web Application through this application I am sending the URL to download the .apk file.now I have to use this URL in my Android Simulator browser to download .apk file and install automatically.So can anyone please give me the solutions to this problems?
推荐答案
只要做到这些步骤操作:
Just do these step:
1,下载文件中使用的AsyncTask或服务。解决方案
1, Download file use Asynctask or Service. Solution here
2,通下载的文件,安装程序包。
2, Pass downloaded file to package installer.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent);
这组简单的路径,下载的文件和MIME类型。更详细的 .您还可以看看的权利。有像你这样的相关问题清单
It's simple set path to downloaded file and mime type. More detail here. You can also look to the right. There is a list of related questions like yours
这篇关于如何下载和放大器;在安装Android应用程序.apk文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!