0

I had loaded my app to play store and now i change the structure of my application. The old version use simple activity and now the new version is maded like Gmail or play store.

I make a new project with same code and same Database and i would like to know if i load the new apk in the play store the user that update the app can lose the DB data?

How can i make a bakcup of data and restore to the new version of my app?

Dario
  • 732
  • 7
  • 30
  • Are You using local db(SQLite) ? – Cryperian Sep 15 '16 at 11:06
  • @Dario If you are using SQLite then just increment DATABASE_VERSION by one if there any changes you made in DB else no need. – Nisarg Sep 15 '16 at 11:07
  • yes, sorry i miss the type of DataBase....i use SQLite.... but my problem is that i make a new project with same package of the old project and i would firm it with the same key and load the apk in the old version of project....if it take it like update i think that the DB is the same and the user don't lose data (like a simple app update).... but now i would try to load a new project with same apk. Anyway i can make a backup to Google Drive and take data back from there? – Dario Sep 15 '16 at 11:10
  • And when your DB structure changed then you check difference with this method onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) ; – Cryperian Sep 15 '16 at 11:11
  • @Hayk and if the package is different? the database change or not? – Dario Sep 15 '16 at 14:51
  • @Dario If the package is different then app also different, therefore created another DB instance for new package. Please see this post http://stackoverflow.com/questions/7053809/share-sqlite-database-between-2-android-apps – Cryperian Sep 15 '16 at 14:55
  • @Hayk thanks for the link....very interesting....so if i create a new project app with same package and i load the apk in the old project and the database structure is the same of the older app, the user don't lose data.... I will try with my phone in local and if i had some problem i write here more detail! – Dario Sep 15 '16 at 15:31

0 Answers0