Android Question Sql & Google Play

Carcas

Member
Licensed User
Longtime User
Hello everyone

I published an application on Google Play. When I uninstall the app all the SQL data files are reset. I dont' want this.

When I try with b4bridge this does not happen.

There needs to be some special code in the manifest?

Thank You
 

Carcas

Member
Licensed User
Longtime User
Sorry I'll explain,

if I uninstall and then reinstall the application SQL data is lost.

With b4bridge not happen
 
Upvote 0

eps

Expert
Licensed User
Longtime User
You can either write 'all' the data out to a file and then re-import it or store it in a List or similar and re-build... It really depends on how the data is structured and how many records have been created / modified that you want to store (some of the data must be static or standard...).

I think if someone uninstalled and reinstalled then they wouldn't expect their data to still be there. If they upgraded to a new version then they would expect the data to remain. I used to use a file, but then found that grabbing the data and storing and then restoring was the best solution for this.

Be careful if the database structure has altered this can also lead to issues..
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
Thanks for the answer but I do not think I understood.

I know of other ways to save data to a file :(

could you tell me how?
 
Upvote 0

parijs

Active Member
Licensed User
Longtime User
Do you use

If File.Exists(File.DirRootExternal, "Dir/data.db") = False Then

In your code?
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
I was using file.dirinternal

but now I'm using

salva.Initialize(File.DirDefaultExternal, "Salvataggio.db" ,True)

I'm waiting for the update is published to try
 
Upvote 0

parijs

Active Member
Licensed User
Longtime User
If I uninstall the app the dbase wil stay.
and us this code for not overriding the db


B4X:
If File.Exists(File.DirRootExternal, "Transmis/trasmis.db") = False Then
File.MakeDir(File.DirRootExternal,"Transmis")
File.Copy(File.DirAssets,"trasmis.db", File.DirRootExternal, "Transmis/trasmis.db")
End If
 
Upvote 0
Top