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

  • Home
  • SEARCH
  • 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 3438370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:10:46+00:00 2026-05-18T08:10:46+00:00

I have posted this question over a week ago on the Android dev list

  • 0

I have posted this question over a week ago on the Android dev list but so far no responses.

I have run into a weird issue. I work with a database located on /sdcard/ and for some reason whenever I add <uses-sdk android:minSdkVersion="8" /> to the manifest sqlite opens the db as read only. It gets a bit weirder too. The below code opens the db and checks if the db is readonly, which returns false:

db = SQLiteDatabase.openDatabase("/sdcard/test.db3", null,
SQLiteDatabase.OPEN_READWRITE);
Log.i(LOGTAG, "Database status: " + db.isReadOnly());

but if I try to write any data it bombs with:

INFO/Database(6576): sqlite returned: error code = 8, msg = prepared
statement aborts at 24: [INSERT INTO tags(type_id , tag)
VALUES(?, ?);]
ERROR/Database(6576): Error inserting type_id =1 tag=TestTag
ERROR/Database(6576): android.database.sqlite.SQLiteException: error
code 8: attempt to write a readonly database

If I remove the uses-sdk tag from manifest everything works fine. I verified this behavior on the emulator, NexusOne running 2.2.1 and Galaxy Tab. Is this a known issue? Is there a workaround?

Any help will be greatly appreciated.

  • 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-05-18T08:10:47+00:00Added an answer on May 18, 2026 at 8:10 am

    You need the WRITE_EXTERNAL_STORAGE permission.

    Also, never never never never never hardcode the path to external storage the way you are doing. Your code will break on Android 2.2 devices. Your code will break on other devices. Use Environment.getExternalStorageDirectory(), please.

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

Sidebar

Related Questions

I have already posted a question about this, but the situation has changed sufficiently
I have already posted another question about this, but no one seemed to know
I originally posted this question over at the Zend Forums but figured it would
in a related question I have posted this code. It almost works, but the
I know many times this question has been posted over here. But i am
I little while back I posted this question . I have updated that question
So I just have posted a question about this code (which was answered): $(document).ready(Main);
I'm asking this question because I have gone through the tutorial posted here: Preventing
This sounds like a problem many others have posted about, but there's a nuance
I posted a thread about this earlier and have made some progress but now

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.