2

I have an App on Playstore. The app is named Credit Flow.It is used to track income and expenses of an individual. I use local Sqlite Db to save all the transactions(they are not saved on any server). I am new to pushing apk updates. My question here is that if I upload a new Apk on playstore will it erase the existing user's Local Db?

If so how can I prevent that?

  • I want to add that if you're updating the database version then the app will erase the locale copy and rebuild the database again. In this scenario you will loss all the data in the local database. – Nativ May 15 '16 at 07:38

2 Answers2

1

My question here is that if I upload a new Apk on playstore will it erase the existing user's Local Db?

No. Assuming you are using your database in the default directory, your database will remain untouched.

The database will only be removed if the user uninstalls your application, or goes into the app settings and clears your app's data.

Also note that onUpgrade() will not be called on your SQLiteOpenHelper. That method is only called when you increment the version number passed into the SQLiteOpenHelper constructor.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
1

No, the data is preserved. But ensure your using the same package name. Updates do not alter sharedpreferences or databases or other files that generated in run time

j2emanue
  • 60,549
  • 65
  • 286
  • 456