androidgoogle-playandroid-sqliteapkandroid-update-app

Android Update app without disturbing local Sqlite DB


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?


Solution

  • 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.