I use reading and writing to the database without any problems . But I can not find out the difference. I searched on Internet but it ‘s not quite clear. Can anyone tell me the difference? In which case should I use getWritableDatabase() or getReadableDatabase()?
I use reading and writing to the database without any problems . But I
Share
Check the Reference
public synchronized SQLiteDatabase getReadableDatabase ()
Since: API Level 1
Like getWritableDatabase(), this method may take a long time to return, so you should not call it from the application main thread, including from ContentProvider.onCreate().
Returns
Throws
SQLiteException if the database cannot be opened
public synchronized SQLiteDatabase getWritableDatabase ()
Since: API Level 1
Database upgrade may take a long time, you should not call this method from the application main thread, including from ContentProvider.onCreate().
Returns
Throws
SQLiteException if the database cannot be opened for writing