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

The Archive Base Latest Questions

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

I need to use the device camera to take a picture, save it into

  • 0

I need to use the device camera to take a picture, save it into its memory and get the uri so I can email it afterwards.

I’m using Android 3.2 on a device with no memory card (just 11 gigs of internal storage).

    private void takePicture(){
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(intent, 1);
}

public void onActivityResult(int requestCode, int resultCode, Intent data){
       if(requestCode == CAMERA_PIC_REQUEST && resultCode == Activity.RESULT_OK){
           picture = (Bitmap) data.getExtras().get("data");
           pictureView.setImageBitmap(picture);

           ContentValues values = new ContentValues();
           values.put(Images.Media.TITLE, "Picture");
           values.put(Images.Media.BUCKET_ID, "picture_ID");
           values.put(Images.Media.DESCRIPTION, "");
           values.put(Images.Media.MIME_TYPE, "image/jpeg");

           pictureUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);
           OutputStream outstream;

           try{
               outstream = getContentResolver().openOutputStream(pictureUri);
               picture.compress(Bitmap.CompressFormat.JPEG, 100, outstream);
               outstream.close();
           }catch(FileNotFoundException e){

           } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       }
   }

Any help from someone more experienced with this would 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-27T03:59:28+00:00Added an answer on May 27, 2026 at 3:59 am

    To keep something in memory you’d just declare a variable or data structure to hold it; in this case some form of a byte array seems promising. I don’t think that would work very well in this case, though. The heap in Android is usually capped at 16 or 25 mb, and depending on what else your app is doing storing photos would get to an “Out of Memory” exception quickly.

    So with no SD card, this leaves you with writing to internal storage. I don’t know which, if any, directories on internal storage the app can write without root access and/or mounting the system read/write, but I think the best bet is /data/tmp. See if you can save the pic there. If not, mounting the system read/write isn’t so bad either.

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

Sidebar

Related Questions

When I develop android apps, sometimes I need to use device and sometimes emulator,
I am developing a Cocoa/Objective-C application. I need to use an external device to
Actually i need to get the device current position. like device is in south-west
I need to produce an audio file on an Android device that can be
I need to use my phone as emulator/target/virtual device when I run my application.
Using an Android (2.3.3) phone, I can use the camera to retrieve a preview
I wrote kernel module which do nf_register_hook and use character device mechanism to get
I need to use geocoder to get lang and lat from address for google
Need to use own imaged markers instead built-in pins. I have several questions. 1.
I need to use sed to convert all occurences of ##XXX## to ${XXX} .

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.