krishnamahadik
krishnamahadik

Reputation: 220

How to Update application instead of Replace application in Android for Non-Market Application

Thanks in advance for reading the query.

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.

What I want ?

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.

What did I did ?

I tried to update my application by

old application Android Manifest

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

New application Android Manifest

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

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"); 

What I get ?

  1. I am not able to update application silently in background.
  2. I get Replace application instead of Update application, while installing update.

Thanks & Regards Krishna V. Mahadik

Upvotes: 2

Views: 744

Answers (1)

Rajendra
Rajendra

Reputation: 1698

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

here is link 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

Upvotes: 1

Related Questions