3. Import database
The dbfiles class module also contains an import_database method.
With this method you can import an existing (exported) database into your app (if the database structure is correct of course).
As you might have noticed the export_database method also copies the database file to the import folder.
To use the file in the import folder you have to add this line of code in the B4XPage_Created subroutine:
datafiles.import_database("budget_db")
You have to place this line above the line that contains the database initialize call like this:
' dbfiles class import before db.initialize!
datafiles.Initialize
datafiles.import_database("budget_db")
'
db.Initialize("mybudget","budget_db",True,False)
So now you can replace the database file in the import folder and the changes will be taken into the app.
You can change the exported file with a SQLite tool like SQLiteDatabaseBrowserPortable.exe or SQLite Expert Personal and then copy that file to the import folder of your app to use.
OR there is an other way... check out the next chapter called Database Manager.