Query if Android database exists!

I’d rather check the existence of the file directly:

private static boolean doesDatabaseExist(Context context, String dbName) {
    File dbFile = context.getDatabasePath(dbName);
    return dbFile.exists();
}

Leave a Comment