Android Question Google Play APK update installation issue

Discussion in 'Android Questions' started by Taha, May 8, 2015.

  1. Taha

    Taha Member Licensed User

    I found that if new version of APK was updated through Google Play some (I am not sure) additional files (in Files folder) were not overwritten. That leads to application mistakes for example if new table added into database file.

    Is it possible to force files replacement or clean installation (uninstall previous version and then install new)?
     
    Last edited: May 8, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    The assets files will be replaced. Other files will not be replaced.
     
  3. Taha

    Taha Member Licensed User

    Code:
    Sub Process_Globals
    DimDBFileNameAsString : DBFileName = 
    "MyDB.db"
    DimDBFileDirAsString : DBFileDir = 
    File.DirInternal
    End Sub
    ...
    If File.Exists(DBFileDir, DBFileName) = False  Then
                
    File.Copy(File.DirAssets, DBFileName, DBFileDir, DBFileName)
                SQL1.Initialize(DBFileDir, DBFileName, 
    False)
            
    Else
                SQL1.Initialize(DBFileDir, DBFileName, 
    False)
            
    End If
    ...
    This is strange from the code - the file is supposed to be copied from Assets folder.
     
  4. NJDude

    NJDude Expert Licensed User

    Your code is copying the database ONLY if it doesn't exist on the device, if you update the app, the DB already exists and it won't be overwritten.
     
    Taha and thedesolatesoul like this.
  5. Taha

    Taha Member Licensed User

    Ooooh, yes, you are right! Many thanks, NJDude!
     
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