barx Well-Known Member Licensed User Longtime User Jul 10, 2011 #1 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: Code: Copy 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
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: Code: Copy 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 Jul 10, 2011 #2 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
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.
barx Well-Known Member Licensed User Longtime User Jul 10, 2011 #3 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
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
Erel B4X founder Staff member Licensed User Longtime User Jul 11, 2011 #4 I recommend you to read this tutorial: Android Process and activities life cycle FirstTime will always be true after an update. Upvote 0
I recommend you to read this tutorial: Android Process and activities life cycle FirstTime will always be true after an update.