PDA

View Full Version : Android / necessitas: SQLITE error ("Driver not loaded")



Al_
21st August 2011, 15:14
Hi
I use necessitas to write a database application for Android. There is an error when opening the SQLITE database. To track the error, the app writes debug strings to QListWidget debugWidget.


QSqlDatabase winebase;
winebase = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"));
QString databaseFile;
debugWidget->addItem(databaseFile);
QFile databaseF(databaseFile);
debugWidget->addItem(QLatin1String(databaseF.exists() ? "exists" : "NOT exists"));
winebase.setDatabaseName(databaseFile);
debugWidget->addItem(winebase.isValid() ? QString(QLatin1String("winebase valid")) : winebase.lastError().text() + QLatin1String(" wb error"));


The database file exists, but winebase.lastError().text() is "Driver not loaded Driver not loaded" (presumably duplicated because QSqlError::text() concatenates error strings from databaseText and driverText).

How to install QSQLITE driver on Android device?

Hard- and software details
device: Acer iconia Tab A500 running
OS: android 3.1 Honeycomb (i.e., API level 12)
QtCreator: with necessitas 4.7.62.1, libraries installed on device using ministro
Desktop OS: Ubuntu natty

Al_

PS: application runs fine on desktop


Added after 41 minutes:

After some further google searches, it seems that somebody found a solution, see https://groups.google.com/forum/#!topic/android-qt/YkwoA42_mzU (answer of Anonymous, 18-Aug-2010). However, I do not find androidconfig.sh (Linux:/$ sudo find . -name androidconfig.sh returned nothing).

Has the file androidconfig.sh been renamed since Aug 2010? Where should it be located?

Al_

Al_
28th August 2011, 15:06
I could meanwhile compile necessitas; the config file is now called androidconfigbuild.sh, and (different from the instructions on the necessitas wiki (http://sourceforge.net/p/necessitas/wiki/Compile%20Qt%20framework/)) it is not in the root of the project directory but in android/androidconfigbuild.sh.

I am still not able to deploy the library to the device. I open a separate thread for this.