Android Question Sql & Google Play

Discussion in 'Android Questions' started by Carcas, Feb 26, 2015.

  1. Carcas

    Carcas Member Licensed 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
     
  2. Carcas

    Carcas Member Licensed User

    Sorry I'll explain,

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

    With b4bridge not happen
     
  3. eps

    eps Well-Known Member Licensed 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..
     
    mangojack likes this.
  4. Carcas

    Carcas Member Licensed 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?
     
  5. parijs

    parijs Active Member Licensed User

    Do you use

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

    In your code?
     
  6. Carcas

    Carcas Member Licensed 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
     
  7. parijs

    parijs Active Member Licensed User

    If I uninstall the app the dbase wil stay.
    and us this code for not overriding the db


    Code:
    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
     
  8. Carcas

    Carcas Member Licensed User

    It Work :)

    Thank You
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice