Android Question Why does the earlier database on mobile not get overwritten during compilation ?

beelze69

Active Member
Licensed User
Longtime User
Hi,

When we choose 'Compile & Run' from B4A ide why the new database does not get overwritten on the mobile ? Why is it that I have to UNINSTALL the earlier application from my mobile to delete that database on my mobile ?

Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
why the new database does not get overwritten on the mobile ?
Because you probably ONLY copy the Database from the assets when the Destination-DB does NOT exists.
Check your code; it may give you more info. You give us not enough information to give a congrete answer.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Why is it that I have to UNINSTALL the earlier application from my mobile to delete that database on my mobile ?
A uninstallation will remove all data from the internal path. You probably created (or coped the db to) the database in this folder.

As your database gets removed when you uninstall a app. You also lost all the databaseentries a user may have done in the past to this database.

The correct solution is to use versioning in your database.

https://stackoverflow.com/questions/7227566/android-database-versioning

https://riggaroo.co.za/android-sqlite-database-use-onupgrade-correctly/
 
Upvote 0
Top