Do added files auto update.

barx

Well-Known Member
Licensed User
Longtime User
Say I add a SQLite database file to a project (like I have), but then edit / add info to the original database under windows environment. Will the file auto update in my app or do I add it again?

If I have to add it again (which I suspect I will), how will that effect this statement:

B4X:
   If FirstTime Then
      If Not(File.Exists(File.DirInternal, DataBaseName)) Then
         dbutils.CopyDBFromAssets(DataBaseName)
      End If
      
      SQL.Initialize(File.DirInternal, DataBaseName, False)
   End If

Obviously, As I have been developing and testing app, it's not the first time it has been run so the new database won't be copied to the reading destination. Hope that makes sense.

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The files under <project>\Files get packaged in the APK file each time you compile your program. This means that is you are updating the files located in this folder then they will be updated automatically.

File.DirInternal is kept during reinstallation. It will only be deleted if you manually uninstall the application.

FirstTime is true whenever the application process starts. This is always the case when you run a program from the IDE. You can put a breakpoint to see it.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Thanks for another great explanation Erel.

When does 'FirstTime' not = true then, is when the app is started by user then closed by user (back button pressed) and the loaded again by user but kept open in the meantime by system? Does 'FirstTime' always = true after an update to the app?

Thank you
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…