Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Capture photo

In my application, i have to implement native camera activity where i have to launch the camera and take photo.

In detail, my application containing, One TextView (at top) to display activity name and one Button (At bottom) and in Middle Area of the screen, Camera preview should be viewed..When user click on that Button, Snaps should be clicked and display it into Imageview of another activity.

I know that the following approach is used:

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
startActivityForResult( intent, 0 );

But this approach if i used then my textview and button view is not displayed.

(Pls note that: I am using Android SDK 1.5 with HTC Hero)

pls help me by suggestion of any article, site, or pdf.

thanx, paresh

like image 867
Paresh Mayani Avatar asked Aug 16 '10 09:08

Paresh Mayani


People also ask

How do you capture an image?

image capture (image acquisition) The process of obtaining a digital image from a vision sensor, such as a camera. Usually this entails a hardware interface known as a frame grabber, which captures single frames of video, converts the analogue values to digital, and feeds the result into the computer memory.

How do I view a captured image on Android?

This is done as follows: Intent camera_intent = new Intent(MediaStore. ACTION_IMAGE_CAPTURE); startActivityForResult(camera_intent, pic_id); Now use the onActivityResult() method to get the result, here is the captured image.

Does image capture work with Android?

Image Capture on your Mac The native app macOS app that works with a lot of third-party devices is Image Capture. Not only can you use it for your iPhone or DSLR camera, but you can also use a scanner with the app. That also means you can use it to import pictures from your Android too.


1 Answers

If you are trying to use the native camera, once the native camera is called it will control your view. However if you want to implement your own camera, then such a layout would be possible. Some good examples can be found here:

  • http://www.brighthub.com/mobile/google-android/articles/43414.aspx

  • http://labs.makemachine.net/2010/03/simple-android-photo-capture/

  • http://www.jondev.net/articles/Capturing,_Saving,_and_Displaying_an_Image_in_Android_(1.5,_1.6,_2.0,_2.1,_2.2,_Sense_UI_-_Hero)

Goodluck!

like image 120
ninjasense Avatar answered Oct 12 '22 23:10

ninjasense