🟥 [FREE] SimpleSqlite - an extension for working with SQLite Databases

Hi team


, I need som help about SQLlite extension when I working with companion on the phone, I try to import the database from the phone, this is a empty database with all tables and I need to begin the app with this database, not to 'create' the tables on then phone. Well, with sqllitestudio I create this database and transfer it to phone but the "Import" method of this extension return all time 'error', pls, can someone tell me where I can put the empty database for the import to work. thans.

From the documentation

The simplest way is to upload the database into the assets of your app, see also @TIMAI2's guide METRIC RAT AI2 - Working with SQLite

Else use the file component to copy it from shared storage /Download or /Documents to the ASD and import from there

Taifun

Which extension are you using ? (SQLite1) ?

Mmmm... may be OK set column headers to false using a clock started by Screen1.Initialize?

Column Headers Bug now fixed, download latest version 3
Also ListFixer merged to main extension
SimpleSqliteV3

Android 8.1:

Android 12:

2 Likes

For Android <10 there is a bug (typo ?) that carried over from the original extension

return getExternalStoragePath() + "/AppInventor/data/";

should read

return getExternalStoragePath() + "/AppInventor/assets/";

Should now be fixed

For Android 12, just use //myDatabase.sqlite, extension is looking for // for asset files

Android 8.1 - a relative path seems to work:

2 Likes

Android 11: (this path is redirected to the ASD)

2 Likes

... the same of course on Android 10+

On Android ≤ 9 a relative path must therefore be set (at least as long as this is not adjusted in the extension).

Hmmm, looks like

is doubling up on /storage/emulated/0....

Will test some more

Yes, I think (and find on the forum next I post this question) this extension dont work with Android 10. The question is all my code is coded with the SqlLite extension and if I go to use the SimpleSqlite extension I will recode all my app. Really there are no way to "import" a empty (preformated with tables) database to use with sqllite? Any solution welcome. thanks. Ex. move (with the app) the database to a directory that can use the sqlite extension?...
Solved: I have used the method "dbname" of simplesqlite to change the name (and dir) of the db to the name (and dir) of db that expects the extension sqllite before import the database. To import the database I used the method ImportDatabase of simplesqlite extension. thanks.

You could have done exactly the same thing with Taifun's extension. Have you updated to the latest version which works with Android <=10?

Version 3 on Android 9:

1 Like

@Anke, many thanks for all your help with sorting out file paths :+1:

I got this error:

after tick the returncolumnheaders then untick, this error message will not popup again.

Is this with the latest version ?

Try with V3 from link in first post....

yes, it's v3 from first post
image