Storage of SQLite database

I have a Samsung Galaxy Note 8 with Android 9.
I made an app, with app inventor and SQLite database.
I don't find the database anywhere... both in companion emulation and in the definitive app.
Nothing in assets, nothing in /data/user/0/..., nothing in SD.
If I do a search for the name of database (the one indicated in the properties of the sqlite component) or for the name of the application, I don't find nothing in my smartphone.
Where is stored the database ?
How can I edit it with db browser ?
How do I make a backup or save it in case of smartphone change ?
Thanks !

you will not find the SQLite database... it is stored here
/data/data/[packagename]/databases

you can't edit it, what you can do is to import or export the sqlite database and edit it then... my sqlite extension is able to import or export ... App Inventor Extensions: SQlite | Pura Vida Apps

export the database

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks very much.
I don't have the directory /data/data
I have only /data/user/... and no package name.
For the rest, ok. Thanks !

Taifun

In PuraVidaApps site I read this:

Export database.
Prefix the filename with / (i.e. relative path) to store the database on the SD card. For instance /myDatabase.sqlite will store the database at /mnt/sdcard/myDatabase.sqlite. If fileName starts with file:/// you can specify a complete path to the database to export.

But, I've tried and if I use:
/MyDb.db --> the database is exported in /storage/emulate/0/MyDb.db
//MyDb.db --> the database is still exported in /storage/emulate/0/MyDb.db
file:///storage/MyDb.db --> give me an error (database not exported).
No way to choose a different destination and/or export into an SD ? I've granted (I think :thinking:...) read and write permission.
Thanks.

did you buy the extension or are you using the example project from Google Play?

this is a correct relative path and the file is stored in the root directory of the internal (emulated) sdcard

not possible, you can't store files in the assets of the app

this is not a valid path

are you talking abut an external (removable) sdcard?
newer Android versions only have read access to the removable sdcard...
which Android version are you usng for your tests?

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Hi.
I use a version of SQLite downloaded from github.com (https://github.com/frdfsnlght/aix-SQLite/)
I am using Android 9 on a Samsung Galaxy Note 8.
Yes, I was thinking of a removable SD...
What is a valid path where to export a database other than /storage/emulate/0 ? And the name have to begin with file:/// as written in PuraVida site or it is a mistake ?
Thanks

It is

/storage/emulated/0
1 Like

it is not possible to store a file there

I only can talk about my extension... other extensions might work different and you better ask the author of that extension...

for my extension you can use a full path, which is for example file:////storage/emulated/0/yourPath/yourDatabase.sqlite
or a relative path /yourPath/yourDatabase.sqlite

Taifun
PS: I edited your post and added a link to the documentation of that extension...

1 Like

Of course, if you do not want to store/run your sqLite database on your device, there is always:

HOWTO: php SQLite3 with AI2

1 Like