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 8022943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:24:56+00:00 2026-06-04T22:24:56+00:00

I have got a an image path stored in a string: if(uri != null)

  • 0

I have got a an image path stored in a string:

if(uri != null) {
              Cursor cursor = getContentResolver().query(uri, new String[] {   
                                       android.provider.MediaStore.Images.ImageColumns.DATA}, 
                                       null, null, null);
                    cursor.moveToFirst();
                    String image = cursor.getString(0);             
                    cursor.close();

How can I insert/ retrieve this string into/ from this database?

private static final String DATABASE_CREATE =
    "create table " + DATABASE_TABLE + " ("
            + KEY_ROWID + " integer primary key autoincrement, "
            + KEY_IMAGE + " text not null)"; 
  • 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-04T22:24:58+00:00Added an answer on June 4, 2026 at 10:24 pm

    You should use ContentValues instance and insert() method of SQLiteDatabase.

    ContentValues cv = new ContentValues();
    cv.put(<column>, <data>);   
    cv.put(<column>, <data>);
    cv.put(<column>, <data>);       
    db.insert(<tableName>, <columnHackNull>, cv);
    

    This way is generally recommended and clean.

    EDIT:

    For retrieve data from database, basic example:

    String SELECT_QUERY = "SELECT * FROM Table";
    Cursor c = db.rawQuery(SELECT_QUERY , null);
    

    or with whereArgs

    String SELECT_QUERY = "SELECT * FROM Table WHERE id = ?";
    String[] whereArgs = {"<data>","<data>"};
    Cursor c = db.rawQuery(SELECT_QUERY , whereArgs );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have currently got imagepaths stored within the database and image files stored in
I have got image url path like : http://localhost:3810/images/test.png What I am looking is
I have got an image path that I want to store in the shared
I'm trying to build the simple layout that I have got in the image
I have got an ActiveX Control that gets an image from a fingerprint device
I have got the following code. I a=have added an image in a folder
I have a URL for an image (got it from UIImagePickerController) but I no
I have got an image file which has 3 colors as background. I have
I have done image to video conversion in iphone(of course I got the code
I have a user control that's got an image ..when I added it to

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.