0

I am working on an app that involves a lot of sqlite database functions and sharedpreferences...

I would like to ask whether the sharedpreferences and sqlite data will be kept if the user updates the app through the Google Play?

Cœur
  • 37,241
  • 25
  • 195
  • 267
pearmak
  • 4,979
  • 15
  • 64
  • 122
  • almost a duplicate, except the Sqlite part of the question is not in the duplicate. By closing based on the sharedpreferences, we lose a datapoint regarding sqlite info. and the next person worried about sqlite data being lost on an update gets to write another question? – Richard Le Mesurier Mar 01 '14 at 10:25

2 Answers2

0

All SharedPreferences and databases are kept upon update. Your database will be upgraded if you change the database version on your SQLite helper class.

Emmanuel
  • 13,083
  • 4
  • 39
  • 53
  • actually i would like to know more about updating the database version...is the database version referring to the version in the android manifest version (say, changes from 1 to 2)? – pearmak Sep 22 '13 at 16:58
  • No. Changing the manifest version does not cause the `onUpgrade()` on your `SQLiteHelper` to be called. It will only be called if the versions of the database are different. The version of your database is specified on the `SQLiteHelper` constructor. – Emmanuel Sep 22 '13 at 18:10
0

Yes, the application settings and any private application files (like SQLite databases) are kept when the user updates the application. They are only removed when the app is explicitly uninstalled.

nomachinez
  • 521
  • 4
  • 6