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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:59:27+00:00 2026-05-21T06:59:27+00:00

Can i get an image from SD card and store it in the application

  • 0

Can i get an image from SD card and store it in the application database??
Is this idea effective in my application??

Thanks in advance!!

Regards

  • 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-21T06:59:28+00:00Added an answer on May 21, 2026 at 6:59 am

    Yes you can get the image from your sd card and store it in sqlite database, we have done it but it will be too expensive for your device……. So be careful about that,

    call image picker intent by calling this

    Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
                        startActivityForResult(i, 12);
    

    It will open default gallery picker view , when you select an image you will be returned in your current activity, So override onActivityResult() and look for result code 12.

    in that code you can get cursor by these lines

    Cursor cursor = getContentResolver().query(selectedImage,
                        filePathColumn, null, null, null);
    cursor.moveToFirst();
    

    From that cursor object you can get the file path of image by these lines

     int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
     String filePath = cursor.getString(columnIndex);
    

    Here is the bitmap object

    Bitmap bMap = BitmapFactory.decodeFile(filePath);
    

    Get byte arrays

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    
    bMap.compress(Bitmap.CompressFormat.PNG, 100,out); 
    byte[] imageArray = out.toByteArray();
    

    Now you have to store imageArray as blob in your database. And you are done…. Don’t forget to refer this post from where i got the solution…

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

Sidebar

Related Questions

I am using this to get image bytes from the database cmd.CommandText = select
My problem is that I can't seem to get the image from my bundle
can any one guide me how to get parameter specially image from the given
I get image data from NSURLConnection , and store the data using NSMutableData .
So, what I'm actually looking for is this solution: Get/pick an image from Android's
Can I get an image from image view? Please tell me what the code
I am try to get the image from this url. http://open.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-1,51.466407,-0.952418,0,0%7Cpurple-2,51.466102,-0.958293,0,0%7C&center=51.466252499999996,-0.9553555&zoom=12&key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&rand=2031817700&session=4eeb5481-00f2-0000-02b7-64f1-002655800398 I can successfully
can not get the imageData the browser console "Unable to get image data from
How can I get an image to stretch the height of a DIV class?
Given a path and filename how can I get the Image object: Image image

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.