I\'m trying to make an Android demo. In the demo, I have to show the camera in an activity and take a picture before advancing to another activity where I can see the camera
Here is the code sample.
Uri mOutputFileUri;
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, mOutputFileUri); // URI of the file where pic will be stored
startActivityForResult(intent, TAKE_PICTURE_FROM_CAMERA);
Then in your onActivityResult just check the resultCode and get your image from mOutputFileUri.
You would also want to check for the external media presence and handle the issues with the camera application behavior for HTC devices.