I’m trying to connect to a Sqlite-DB. Testing on a device, I get a class-not-found-exception. I connect like so:
Class.forName("org.sqlite.JDBC");
connection = DriverManager.getConnection("jdbc:sqlite:" + applicationPath + "data/appdata.db");
where the application path comes from the context and points to the data-folder. So far so good. The jar is in the build path and in the manifest,I have the following permissions:
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
What am I missing? Any pointers appreciated!
Best regards,
Marcus
Some manufacturers deliver the devices without sqlite being installed on them. You can copy the sqlite program though from a emulator to your device if the device has an arm processor.
Start the emulator and use the adb command from the platform-tools in android-sdk
adb pull /system/xbin/sqlite3
Mount the system partition of your device read/write after this tutorial:
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
Use the adb command to copy the sqlite3 file to your device
adb push sqlite3 /system/xbin/
After you reboot your device the sqlite3 command should work.