Code example for SQLiteOpenHelper

Methods: getReadableDatabasegetWritableDatabase

0
	} 
 
	public MyNoteDBAdapter open() throws SQLException { 
		try { 
			Log.d(TAG, "about to getWritableDatabase");
			db = dbHelper.getWritableDatabase();
		} catch (SQLiteException ex) {
			Log.d(TAG, "about to getReadableDatabase");
			db = dbHelper.getReadableDatabase();
		} 
		return this;
	} 
 
	public void close() { 
		db.close();
	} 
 
	public MyNoteDto insertMyNote(MyNoteDto mynote) {
		// Create a new row of values to insert. 
		Log.d(TAG, "about to insertMyNote: " + mynote.getKey());
        // Gets the current system time in milliseconds