NOT_A_PROGRAMMER
NOT_A_PROGRAMMER

Reputation: 1924

Android sqlite asset helper jar not working with zip.file

I am using Android Studio It works fine when I was using the actual SQLite file (my file name is crud.sqlite).

But when I try to use zip file(crud.zip) instead of crud.sqlite. the app crash and log say something like unable to find the database file or something like that. I wish I can show you but somehow my debug is not working anymore.....

I hope you guys can help me out. - The crud.zip is in the src/main/asset/databases folder. - I think the problem is in my DBHelper class.

public class DBHelper extends SQLiteAssetHelper {

private static final String DATABASE_NAME = "crud.sqlite";
private static final int DATABASE_VERSION = 5;

public DBHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

}

Upvotes: 0

Views: 683

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007533

The filename has to be crud.sqlite.zip, not crud.zip. This is covered in the documentation.

Upvotes: 1

Related Questions