如何以编程方式更新Android上的pre-安装的应用程序 [英] How to update the pre-installed application programmatically in android

查看:116
本文介绍了如何以编程方式更新Android上的pre-安装的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,其中应用程序安装.apk文件这是可以在我的本地服务器上的应用程序。
 并且如果存在已安装的本地服务器应用程序的任何更新通知,其需要更新该应用程序。我使用GCM发送通知到Android设备的更新和获得的版本code 的通知从和比较它与安装的.apk文件的版本。这个高达事情是正确的。但我还是坚持了如何以便其设置不会更改更新每个安装在本地服务器应用程序。

I am working on an app where app installs .apk file which is available on my local server. and if there is any update notification for the installed local server application,its need to update the application. I am using GCM to send notification to the android device for update and get the versionCode from notification and compare it with the installed .apk version. Upto this things are right. But I stuck with how to update the per-installed local server application so that its setting doesn’t changes.

感谢。

推荐答案

请问Android应用工作作为客户端为您的服务器?如果是这样的话,我不建议你使用服务器端的推送更新通知。如果通知无法到达设备(据我所知,官方文件说,这是正常的行为),用户将拥有过时的版本。这是更好地检查新版本定期/在每个访问服务器,并下载/安装的APK这里解释 和<一个href=\"http://stackoverflow.com/questions/4604239/install-application-programmatically-on-android\">here.您可能还需要看看FDroid 的源$ C ​​$ C,其中包括服务器端和客户端机端的组件和可以获取,下载和应用程序数目安装更新。

Does Android application work as client for your server? If this is the case, I do not recommend you to use server-side pushes for update notifications. If notification fails to reach device (AFAIK, official documentation says, that this is normal behavior), user will have outdated version. It is better to check for new version periodically/on every access to server and download/install apk as explained here and here. You may also want to look at source code of FDroid, which consist of server- and client-side components and can fetch, download and install updates for number of applications.

这篇关于如何以编程方式更新Android上的pre-安装的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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