如何更新应用程序,而不是Android中的非市场应用程序替换 [英] How to Update application instead of Replace application in Android for Non-Market Application

查看:237
本文介绍了如何更新应用程序,而不是Android中的非市场应用程序替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此先感谢读取查询。

我试图从较低版本我的应用程序更新到更高的版本。由于我的应用程序是不是在市场,所以我想从我的web服务进行更新。

I am trying to update my application from lower version to higher version. As my application is not on market, so I want to update from my web service.

我要什么?

我想静静地更新在后台我的应用程序,而无需用户intervetion。如果这是不可能的,更新最少的用户intervenstion(就像谷歌Play更新)具有更新的应用程序的通知,而不是替代应用程序。

I want to update my application silently in background without user intervetion. If this is not possible, update application with minimal user intervenstion (just like Google Play update) with notification of update application and not as replace application.

我是怎么做?

我试图以更新

旧的应用程序的Andr​​oid清单

old application Android Manifest

android:versionCode="1"
android:versionName="1.0"

新应用程序的Andr​​oid清单

New application Android Manifest

android:versionCode="2"
android:versionName="1.1"

code为安装新的更新

Code for install new update

Uri packageURI = Uri.parse(packageName.toString());
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, packageURI);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/"  + ApkName.toString())),"application/vnd.android.package-archive"); 

我得到什么?


  1. 我不能够默默地在后台更新的应用程序。

  2. 我得到替换应用程序而不是更新的应用程序,在安装更新。

感谢和放大器;商祺
克里希纳五Mahadik

Thanks & Regards Krishna V. Mahadik

推荐答案

确定使用可以使用GCM服务来通知要更新用户

ok use can use GCM service to notify the user for update

这里是链接 http://developer.android.com/guide/google /gcm/index.html

,无论您何时更新应用程序,它的安装新版本保持
   应用塞汀因为它是。这件事我已经检查

and whenever you update the application, its install the new version keeping the application seting as it is. This thing i have checked

这篇关于如何更新应用程序,而不是Android中的非市场应用程序替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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