crystal_test
crystal_test

Reputation: 691

What is the process behind upgradation of an app in android. Is it replacement of just the Apk or more?

What is the process behind upgradation of an app in android. Is it replacement of just the Apk or is it something else.

Also

  1. Is it replacement of just the new Apk file (Like reinstalling) or is it updated?

  2. What happens to the database tables which are associated with the older version?

  3. What happens to the shared preferences associated with the older version?

Can anyone also let us know a proper way to simulate this operation before we actually launch it in the market.

Upvotes: 2

Views: 257

Answers (1)

Ovidiu Latcu
Ovidiu Latcu

Reputation: 72311

  1. Yes the application is replaced with the newer one.
  2. The database will be upgraded, so the onUpgrade() method on your SQLiteOpenHelper method will be called, so you need to process with care the data here, for example you may not want to delete the entire database and table, and just upgrade maybe specific tables that have changed.
  3. The ShardePreferences will not be erased, they will be kept.

To simulate this, you can just put an older version of your app on your device, and then install the newer one. This will actually update your application as the Play Store does, and as Eclipse does when you re-install an app, that is allready installed on your device/emulator.

Upvotes: 2

Related Questions