简体   繁体   English

如何从解析服务器下载apk文件并自动安装

[英]How to download apk file from parse server and install it automatically

I have never use Parse.I have aa table on parse having two columns one for versioncode and second column for APK. 我从来没有使用过Parse。我有一个解析表,其中有两列用于版本代码,第二列用于APK。

I have app of version code 2 in my android device.Now I want to implement the logic if my app version code and version code on parse database is different then I want to download the apk file using ParseFile on background and once download is complete then install automatically. 我的Android设备中有版本代码2的应用程序。现在,如果我的应用程序版本代码和解析数据库上的版本代码不同,我想实现逻辑,然后我想在后台使用ParseFile下载apk文件,一旦下载完成,自动安装。

Please help me . 请帮我 。

Thanks in advance. 提前致谢。

This opens the install window of the package manager: 这将打开软件包管理器的安装窗口:

Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);

I don't know what happens when you replace the URI with an URL, but i guess it won't work 我不知道将URL替换为URI时会发生什么,但我想它不起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM