SQLite ImportDatabase

Hello.
Can anyone advise?
Through Media, I made a upload of the Synopsa-ev.db database to the application's assets.
When I try to import it, it doesn't.
The announcement is still: "DB Synopsa-ev.db NEEXISTUJE !!!!!".

Ondrej
block

You have checked you have sqlite on your device ?

which sqlite extension are you using? any link?
you might want to use Do it to find out, if the import was successful...

EDIT: and if you like to import the database only on first run of the app, then you might want to use TinyDB as shown in the Screen.Initialize event here https://puravidaapps.com/sqlite.php

EDIT 2: which device and Android version are you using for your tests?
is this an issue only in the companion app or also after building the app?

Taifun


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

Hello.
I use: org.bennedum.SQLite.aix
I will create an apk and run it on the BlueStacks emulator.
The SQlite Synopsa-ev.db database should only be a local db, it should not be updated, only a record lookup and display.
Is such a procedure good?

  • I will upload Synopsa-ev.db via media,
  • I will only call Call SQLite1.ImportDatabase once and this will create a binary SQLite database file on the local device,
  • Will this binary database file be saved to the apk for future execution?

Ondrej

I am trying to do the same thing but the 1st problem I had is that I am not able to find in the right place the db to import and the second problem may be the format, normally SQLite import/exports using json or xml files. I need to distribute together the app a little SQLite db already loaded with the data needed and then provide a procedure to (eventually) update the DB. But I have problems to open the DB since seems to be in a differente folder than in that the app thinks to be... I found also a test aia but it only partially works so... the problem seems to be not so simple to solve. I am testing it with Android 8 and 11, both have the same main problem: accessing the file that both do not find.

We now have two topics where you ask the same thing.

I will close this one, but here is a link back to your first topic:

https://community.appinventor.mit.edu/t/clarification-on-how-acces-files-on-android-with-compannion/42393/4