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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:48:56+00:00 2026-05-11T12:48:56+00:00

For my application, I’d been using my own Camera class for taking images and

  • 0

For my application, I’d been using my own Camera class for taking images and my own database but soon enough I couldn’t really keep up with changes and I decided to use the built in camera application in Android to do the job, but I can’t seem to get it to save file. What am I missing here? The application seems to save the file but it’s just 0 bytes. I looked up the source code of the Camera application and it’s looking for the ‘output’ in Extras to save the file. Any help would be greatly appreciated.

Public class CameraTest extends Activity {     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         Button cameraButton = (Button) findViewById(R.id.cameraButton);         cameraButton.setOnClickListener( new OnClickListener(){             public void onClick(View v ){                 ContentValues values = new ContentValues();                 values.put(Images.Media.TITLE, 'title');                 values.put(Images.Media.BUCKET_ID, 'test');                 values.put(Images.Media.DESCRIPTION, 'test Image taken');                 Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);                 Intent intent = new Intent('android.media.action.IMAGE_CAPTURE');                 intent.putExtra('output', uri.getPath());                 startActivityForResult(intent,0);             }         });      }      @Override     protected void onActivityResult(int requestCode, int resultCode, Intent data) {         if (requestCode== 0 && resultCode == Activity.RESULT_OK){             ((ImageView)findViewById(R.id.pictureView)).setImageURI(data.getData());         }     }   } 
  • 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. 2026-05-11T12:48:56+00:00Added an answer on May 11, 2026 at 12:48 pm

    This worked with the following code, granted I was being a little dumb with the last one. I still think there’s got to be a better way so that the original image is still saved somewhere. It still sends me the smaller 25% size image.

    public class CameraTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     Button cameraButton = (Button) findViewById(R.id.cameraButton);     cameraButton.setOnClickListener( new OnClickListener(){         public void onClick(View v ){              Intent intent = new Intent('android.media.action.IMAGE_CAPTURE');              startActivityForResult(intent,0);         }     });  }  @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {     if (requestCode== 0 && resultCode == Activity.RESULT_OK) {         Bitmap x = (Bitmap) data.getExtras().get('data');         ((ImageView)findViewById(R.id.pictureView)).setImageBitmap(x);         ContentValues values = new ContentValues();         values.put(Images.Media.TITLE, 'title');         values.put(Images.Media.BUCKET_ID, 'test');         values.put(Images.Media.DESCRIPTION, 'test Image taken');         values.put(Images.Media.MIME_TYPE, 'image/jpeg');         Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);         OutputStream outstream;         try {             outstream = getContentResolver().openOutputStream(uri);             x.compress(Bitmap.CompressFormat.JPEG, 70, outstream);             outstream.close();         } catch (FileNotFoundException e) {             //         } catch (IOException e) {             //         }     } } 

    Also, I do know that the cupcake release of Android should fix the small image size soon.

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

Sidebar

Ask A Question

Stats

  • Questions 97k
  • Answers 97k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I don't believe you can do that with a C#… May 11, 2026 at 7:21 pm
  • Editorial Team
    Editorial Team added an answer Instances of Objective-C objects must be pointers, which is causing… May 11, 2026 at 7:21 pm
  • Editorial Team
    Editorial Team added an answer I would suggest looking at the submitHandler and invalidHandler options.… May 11, 2026 at 7:21 pm

Related Questions

For my application, I want a Combo Box that displays its elements when dropped
For my application, I'd been using my own Camera class for taking images and
I am writing the update system for my application and I need to shutdown
I want to create a volume slider for my application. I don't mind whether
I am creating a RSS feed file for my application in which I want

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.