0

The Question is how exactly google play updates apps.

I mean does it remove older app exactly from files or it just append on it .

For example in my app i have a local database ,after update, will my older local database become removed?

1 Answers1

0

Your old application is definitely deleted. Your app is compiled and packaged, it won't be opened by Google.

As far your database, if you made changes to your database you need to change the "database version" before publishing. And put code inside the onUpgrade() method of your SQL database. This is how you can successfully change your database. If you want to delete the old database, you can delete it inside the method. The database is on the user's device, and will stay there forever until they delete your app or your code deletes it.

I hope I'm understanding your question.

  • Thanks for answer it is so clear but there is a point that i couldnt understand .The point is **And put code inside the onUpgrade() method of your SQL database** What should i put in this method thanks again – Alperen Adatepe Jun 17 '16 at 13:25
  • onUpgrade() method hold older and newer version of the app. So on basis of that you can update your code in newer version of the app. – Dhruv Jun 17 '16 at 13:27
  • If you change your database, for example you add a table, then inside the `onUpgrade()` method, write the code that will add a table. If you want to get rid of an old table, then write the delete code there also. You need the db creation code AND the upgrade code, for both new users and old users. So do not get rid of your current database code. This code will upgrade the user's old database. – Buildersrejected Jun 17 '16 at 13:35
  • I just wonder can you send me an example of code i couldnt understand exactly what should i do for not lose the old database after update – Alperen Adatepe Jun 17 '16 at 13:35
  • Here is a link that should help https://thebhwgroup.com/blog/how-android-sqlite-onupgrade – Buildersrejected Jun 17 '16 at 13:45
  • Thank you so much i understood finally!!. – Alperen Adatepe Jun 17 '16 at 13:59