Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8017209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:46:33+00:00 2026-06-04T20:46:33+00:00

I use reading and writing to the database without any problems . But I

  • 0

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()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:46:35+00:00Added an answer on June 4, 2026 at 8:46 pm

    Check the Reference

    public synchronized SQLiteDatabase getReadableDatabase ()

    Since: API Level 1

    Create and/or open a database. This will be the same object returned
    by getWritableDatabase() unless some problem, such as a full disk,
    requires the database to be opened read-only. In that case, a
    read-only database object will be returned. If the problem is fixed, a
    future call to getWritableDatabase() may succeed, in which case the
    read-only database object will be closed and the read/write object
    will be returned in the future.

    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

    a database object valid until getWritableDatabase() or close() is called. 
    

    Throws
    SQLiteException if the database cannot be opened

    public synchronized SQLiteDatabase getWritableDatabase ()

    Since: API Level 1

    Create and/or open a database that will be used for reading and
    writing. The first time this is called, the database will be opened
    and onCreate(SQLiteDatabase), onUpgrade(SQLiteDatabase, int, int)
    and/or onOpen(SQLiteDatabase) will be called.

    Once opened successfully, the database is cached, so you can call this
    method every time you need to write to the database. (Make sure to
    call close() when you no longer need the database.) Errors such as bad
    permissions or a full disk may cause this method to fail, but future
    attempts may succeed if the problem is fixed.

    Database upgrade may take a long time, you should not call this method from the application main thread, including from ContentProvider.onCreate().
    Returns

    a read/write database object valid until close() is called 
    

    Throws
    SQLiteException if the database cannot be opened for writing

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Reading and writing images to an SQLite DB for iPhone use How
Suppose both parent and child use one pipe for writing and reading means when
I was reading about how you can use the java nio library to take
When reading an NSString from a file I can use initWithContentsOfFile:usedEncoding:error: and it will
I'm trying to use USGS DEMs in MATLAB but after reading it in with
When catching an exception on a database reading/writing operation, what specific exceptions should I
I'm writing a program, some kind of database. While I was reading manual of
Possible Duplicate: Reading and writing images to an SQLite DB for iPhone use How
I am writing code in which i am reading blob image from database and
We keep reading about how to use 'readResolve()' to ensure singleness in case of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.