use of android.database.sqlite.SQLiteFullException in project MiMangaNu by raulhaag.
the class Database method markAllChapters.
public static void markAllChapters(Context context, int mangaId, boolean read) {
ContentValues cv = new ContentValues();
cv.put(COL_CAP_STATE, read ? Chapter.READ : Chapter.UNREAD);
try {
SQLiteDatabase database = getDatabase(context);
if (!database.isReadOnly()) {
database.update(TABLE_CHAPTERS, cv, COL_CAP_ID_MANGA + " = " + mangaId, null);
} else {
Log.e("Database", "(markAllChapters) " + context.getResources().getString(R.string.error_database_is_read_only));
Util.getInstance().toast(context, context.getResources().getString(R.string.error_database_is_read_only));
}
} catch (SQLiteFullException sqlfe) {
Log.e("Database", "SQLiteFullException", sqlfe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (SQLiteDiskIOException sqldioe) {
Log.e("Database", "SQLiteDiskIOException", sqldioe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (Exception e) {
Log.e("Database", "Exception", e);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
}
}
use of android.database.sqlite.SQLiteFullException in project MiMangaNu by raulhaag.
the class Database method updateMangaLastIndex.
public static void updateMangaLastIndex(Context context, int mid, int idx) {
ContentValues cv = new ContentValues();
cv.put(COL_LAST_INDEX, idx);
try {
SQLiteDatabase database = getDatabase(context);
if (!database.isReadOnly())
database.update(TABLE_MANGA, cv, COL_ID + "=" + mid, null);
else {
Log.e("Database", "(updateMangaLastIndex) " + context.getResources().getString(R.string.error_database_is_read_only));
Util.getInstance().toast(context, context.getResources().getString(R.string.error_database_is_read_only));
}
} catch (SQLiteFullException sqlfe) {
Log.e("Database", "SQLiteFullException", sqlfe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (SQLiteDiskIOException sqldioe) {
Log.e("Database", "SQLiteDiskIOException", sqldioe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (Exception e) {
Log.e("Database", "Exception", e);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
}
}
use of android.database.sqlite.SQLiteFullException in project MiMangaNu by raulhaag.
the class Database method updateManga.
/**
* For information,
* <p/>
* setTime = false is "updateMangaNo
* Time"
* setTime = true is "updateManga"
*/
public static void updateManga(Context context, Manga manga, boolean setTime) {
try {
SQLiteDatabase database = getDatabase(context);
if (!database.isReadOnly())
database.update(TABLE_MANGA, setMangaCV(manga, setTime), COL_ID + "=" + manga.getId(), null);
else {
Log.e("Database", "(updateManga) " + context.getResources().getString(R.string.error_database_is_read_only));
Util.getInstance().toast(context, context.getResources().getString(R.string.error_database_is_read_only));
}
} catch (SQLiteFullException sqlfe) {
Log.e("Database", "SQLiteFullException", sqlfe);
outputMangaDebugInformation(manga);
Util.getInstance().toast(context, context.getString(R.string.error_while_updating_chapter_or_manga_in_db, manga.getTitle()));
} catch (SQLiteDiskIOException sqldioe) {
Log.e("Database", "SQLiteDiskIOException", sqldioe);
outputMangaDebugInformation(manga);
Util.getInstance().toast(context, context.getString(R.string.error_while_updating_chapter_or_manga_in_db, manga.getTitle()));
} catch (Exception e) {
Log.e("Database", "Exception", e);
outputMangaDebugInformation(manga);
Util.getInstance().toast(context, context.getString(R.string.error_while_updating_chapter_or_manga_in_db, manga.getTitle()));
}
}
use of android.database.sqlite.SQLiteFullException in project MiMangaNu by raulhaag.
the class Database method updateChapterPlusDownload.
static void updateChapterPlusDownload(Context context, Chapter cap) {
ContentValues cv = new ContentValues();
cv.put(COL_CAP_NAME, cap.getTitle());
cv.put(COL_CAP_PATH, cap.getPath());
cv.put(COL_CAP_PAGES, cap.getPages());
cv.put(COL_CAP_STATE, cap.getReadStatus());
cv.put(COL_CAP_PAG_READ, cap.getPagesRead());
cv.put(COL_CAP_DOWNLOADED, cap.isDownloaded() ? 1 : 0);
try {
SQLiteDatabase database = getDatabase(context);
if (!database.isReadOnly())
database.update(TABLE_CHAPTERS, cv, COL_CAP_ID + " = " + cap.getId(), null);
else {
Log.e("Database", "(updateChapterPlusDownload) " + context.getResources().getString(R.string.error_database_is_read_only));
Util.getInstance().toast(context, context.getResources().getString(R.string.error_database_is_read_only));
}
} catch (SQLiteFullException sqlfe) {
Log.e("Database", "SQLiteFullException", sqlfe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (SQLiteDiskIOException sqldioe) {
Log.e("Database", "SQLiteDiskIOException", sqldioe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (Exception e) {
Log.e("Database", "Exception", e);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
}
}
use of android.database.sqlite.SQLiteFullException in project MiMangaNu by raulhaag.
the class Database method setUpgradable.
public static void setUpgradable(Context context, int mangaid, boolean buscar) {
ContentValues cv = new ContentValues();
cv.put(COL_IS_FINISHED, buscar ? 1 : 0);
try {
SQLiteDatabase database = getDatabase(context);
if (!database.isReadOnly())
database.update(TABLE_MANGA, cv, COL_ID + "=" + mangaid, null);
else {
Log.e("Database", "(setUpgradable) " + context.getResources().getString(R.string.error_database_is_read_only));
Util.getInstance().toast(context, context.getResources().getString(R.string.error_database_is_read_only));
}
} catch (SQLiteFullException sqlfe) {
Log.e("Database", "SQLiteFullException", sqlfe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (SQLiteDiskIOException sqldioe) {
Log.e("Database", "SQLiteDiskIOException", sqldioe);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
} catch (Exception e) {
Log.e("Database", "Exception", e);
Util.getInstance().toast(context, context.getString(R.string.error_while_trying_to_update_db));
}
}
Aggregations