Existing SQLite file is not getting updated when new apk is uploaded to market.

Penfound

Active Member
Licensed User
Longtime User
I have an application on the market being tested by my students. The problem I have is that when I add data to the DB on my PC and then upload the apk the DB is not getting updated.

I am using the following code in the Activity_Create section but this will only update if the DB file does not exist. What do I need to write to make sure the DB is always updated, if it has changed?

If File.Exists(DBFileDir, "studies.s3db") = False Then
If FirstTime Then
ProgressDialogShow("Initialising database...")
File.Copy(File.DirAssets, "studies.s3db", DBFileDir, "studies.s3db")
SQLStudies.Initialize(DBFileDir, "studies.s3db", True)
ProgressDialogHide
End If
Else
If FirstTime Then
ProgressDialogShow("Initialising database...")
SQLStudies.Initialize(DBFileDir, "studies.s3db", True)
ProgressDialogHide
End If
End If

:sign0163:

Cheers
Penfound
 

rbsoft

Active Member
Licensed User
Longtime User
Leave this line of code out...
B4X:
If File.Exists(DBFileDir, "studies.s3db") = False Then
   ...
End If

Then the database always will be updated.

Rolf
 
Upvote 0
Top