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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:32:59+00:00 2026-05-22T11:32:59+00:00

I am new to Android. I have just created an AVD with 256 MB

  • 0

I am new to Android. I have just created an AVD with 256 MB android-SDcard in it in Android 2.1. And I have inserted two images into it. I have done this using the DDMS perspective. And the images are now stored into a folder 100ANDRO in the DCIM folder of SDcard. Now I want to create an application that allows the user to select the images through browsing the folders and need to save the corresponding image to the database android-sqlite.

Can someone help me to find an appropriate method for this? Thanks in advance.

  • 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-22T11:33:00+00:00Added an answer on May 22, 2026 at 11:33 am

    I have found one method for this.

    I have created a button for UPLOAD and on the click action I have set like this.

        upload.setOnClickListener(new View.OnClickListener()
        {
            public void onClick(View v) {
                Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
                photoPickerIntent.setType("image/*");
                startActivityForResult(photoPickerIntent, 1);
    
            }
        });
    

    And I have overrided this method along with the same class as below.

      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        switch (requestCode) {
        case 1:
         {
          if (resultCode == RESULT_OK)
          {
            Uri photoUri = data.getData();
            if (photoUri != null)
            {
            try {
                  String[] filePathColumn = {MediaStore.Images.Media.DATA};
                  Cursor cursor = getContentResolver().query(photoUri, filePathColumn, null, null, null); 
             cursor.moveToFirst();
         int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
         String filePath = cursor.getString(columnIndex);
         cursor.close();
         Bitmap bitmap = BitmapFactory.decodeFile(filePath);
         imgView.setImageBitmap(bitmap);
         int size = bitmap.getWidth() * bitmap.getHeight();
         ByteArrayOutputStream out = new ByteArrayOutputStream(size);
         bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
         try {
         out.flush();
         out.close();
         } catch (IOException e) {
         e.printStackTrace();}
         String bb = out.toString();
         byte[] x = out.toByteArray();
         image_value.setTag(x);
         image_value.setText(filePath);
         }catch(Exception e)
          {}
          }
        }
        }
    

    Here image_value represents a hidden text view in the xml file.
    I have passed the value of the image location and bytes as text view’s value and tag.
    And later on I have saved this bytes into the database for later display. Its working fine.

    Thanks to all.

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

Sidebar

Related Questions

i am creating a new android application.i am using the table layout. I have
I am new to android development. I have created a popup window which is
I am using Android emulator with AVD of Android 2.1 and I have the
I'm new to android. I have some java knowledge (not extensive), and I've done
I have created a new android Emulator based on Android 2.3.3 with 512MB RAM
hi i am a new android developer. In my app i have created a
i am very new to the android app development, and i have just almost
I'm new to Android development and I have this strange problem.. Depending on the
I am new android and I would appreciate some help. I have this code:
hi to all i am new to android i have to send my different

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.