简体   繁体   English

从市场上以编程方式从市场上下载或升级android应用内

[英]android in-app download/upgrade from market apk programmatically

if there's A apk and B apk and both are uploaded market (google play store), 如果同时有A apk和B apk且都是上载市场(Google Play商店),

  1. does A can upgrade A apk from market without moving to play store? A可以在不移动到商店的情况下从市场上升级apk吗? (user doesn't see play store activity, and A apk just download A apk from market url) (用户没有看到Play商店的活动,Apk只是从市场网址下载Apk)

  2. does A can download B apk from market without moving to play store? A可以在不移动到商店的情况下从市场下载B apk吗?

i found unofficial market api, but i want to know official way to do it. 我找到了非官方的市场api,但我想知道官方的方法。 Thanks, 谢谢,

@ i tested market api to download apk from market, then i got 404 error, and found that google changed login process to auth 2.0 is there anyone suceed to download from market programmatically without moving to play store? @我测试了市场api以从市场下载apk,然后出现404错误,并发现Google将登录过程更改为auth 2.0,是否有人能以编程方式从市场下载而不移动商店?

First you need to download the apk and store it on the phone's storage. 首先,您需要下载apk并将其存储在手机的存储器中。 Then you can install that apk using this code, 然后,您可以使用以下代码安装该APK,

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

This intent launches the install dialog with the user, where the user will choose to authorize permissions to the apk being requested to install. 此意图与用户一起启动安装对话框,用户将在其中选择授权对请求安装的apk的权限。

But remember there is no official way to do this, there are many ways and according to me this seems like a good way to do this 但是请记住,没有官方的方法可以执行此操作,根据我的说法,这似乎是执行此操作的好方法

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

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