Working with SQLite in libgdx

I was wondering if there are any users who have worked with libgdx for developing games for the Android platform. I am relatively new to this framework and I am currently stuck with the following problem:

The question was originally posted by me here and is reproduced as is:

I am in the process of developing a game with multiple worlds and levels (each having their individual data) which I want to store in SQLite database on Android. I have implemented SQLite in some very basic apps but so far I am unable to get it working along side the libgdx framework.

What I have actually done is that I am maintaining an Assets class that has some static members for use in classes elsewhere. I have a private static nested class by the name of SQLHelper that maintains the query strings and some private methods to handle the SQLite database when the app runs on an Android phone/Emulator.

Here is a glimpse of the code:

public class Assets {

//A lot of code (unrelated to SQLHelper class) and to be used in classes elsewhere

SQLiteDatabase database;

//SQLHelper class

private static class SQLHelper {

private static String createTableSettings = "CREATE TABLE IF NOT EXISTS settings(settingID INTEGER PRIMARY KEY, settingName VARCHAR(15) NOT NULL, settingParamOne INTEGER NULL, settingParamTwo INTEGER NULL, settingParamThree INTEGER NULL);";

private static String createTableWorldData = "CREATE TABLE IF NOT EXISTS worldData(worldID INTEGER PRIMARY KEY, worldScore INTEGER DEFAULT 0, worldStars INTEGER DEFAULT 0);";

private static String createTableLevelData = "CREATE TABLE IF NOT EXISTS levelData(levelID INTEGER PRIMARY KEY, levelStars INTEGER DEFAULT 0, worldID INTEGER NOT NULL, FOREIGN KEY(worldID) REFERENCES worldData(worldID));";


private static void openDatabase() {

	try {

		database.openDatabase("gameName", null, database.CREATE_IF_NECESSARY);

	} catch (Exception e) {"Exception in opening databases", "This should not happen on an Android Device (This is fine on java.)");




private static void createTables() {

	try {

		database.execSQL("PRAGMA foreign_keys=ON;");

		database.execSQL(createTableSettings, null);

		database.execSQL(createTableWorldData, null);

		database.execSQL(createTableLevelData, null);

	} catch (SQLException e) {"Exception in createTables", "This should not happen on an Android Device (This is fine on java.)");






public static void load() {

myManager = new AssetManager();





And I am getting these type of exceptions registered by the logcat:

02-14 22:45:53.261: E/SqliteDatabaseCpp(578): sqlite3_open_v2(“gameName”, &handle, 6, NULL) failed

Failed to open the database. Closing it.

02-14 22:45:53.291: E/SQLiteDatabase(578):

android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file

Please help me in this regard as I am new to libgdx/SQLite.

I havent used SQLite but I think you sm to have issue with the DB name and schema