在自己的网站上托管 .apk 文件 [英] Hosting an .apk file on over own site

查看:48
本文介绍了在自己的网站上托管 .apk 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求在一个公共网站上托管我的 .apk 文件,而不是 android 市场或任何其他应用程序商店.在安卓市场,注册到市场后,下载的.apk 将自动安装在手机上,无需任何手动操作.因此,我愿意创建一个 URL 并将我的 .apk 文件托管到该 URL 中,并希望将该 .apk 下载到 android 手机中,并且它必须自动安装.

I got requirement to host my .apk file on one public site other than android market or any other app stores. In android market, after registred in to the market the downloded .apk will automatically installed on mobile without any manual action. So I am willing to create one URL and host my .apk file in to that and want to download that .apk in to the android mobile and it has to install automatically.

我该怎么做....请分享是否有任何代码或链接可以重新分级.

How can I do that....plz share if any code or links are there regrading this.

推荐答案

如果 Android 设备选中了 Settings->Applications->Unknown Sources,Android 将允许安装 .apk.如果未选中 - 您将不会成功.

If Android device has Settings->Applications->Unknown Sources checked, Android will allow .apk installation. If its not checked - you will not succeed.

假设勾选了检查栏并且您已经下载了 .apk 文件.您可以运行下一个代码来触发安装:

Assuming that check bar is checked and you have downloaded .apk file. You can run next code to trigger installation:

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(new File(apkFileName));
intent.setDataAndType(uri, "application/vnd.android.package-archive");
startActivity(intent);

这篇关于在自己的网站上托管 .apk 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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