Capture images from camera in Android

Hello friends, In this post, we are going to learn how to capture images from camera in Android and display captured photo in ImageView using Android camera application. Here the User Interface consists of one ImageView and another imageView acting as a  Button to trigger the camera. The imageView will be used to launch the camera of your own mobile and the ImageView will hold any captured image from the camera and store it in your gallery itself.

Capture image From Camera and Store in Storage.
Capture image From Camera and Store in Storage.

Now Lets start with the coding by adding some permissions in the Manifest.xml file.

Below is the permission for the Camera and SD Card Accessing.

Now, Open the layout file of your main activity activity_main.xml and paste the following code,

Fine, let us register both the ImageView object and add an onClickListener to the imageView acting as a button.

That’s all for the post, now install the application in your android phone and click awesome pictures with your own app. 😉

 

Hey there, I’m Sobhini, a Graduate Engineer. I post here very often, fields of interest lies in android programming, web development and UI/UX designing. Follow me to get the latest updates 😉

Sobhini Reddy

Hey there, I'm Sobhini, a Graduate Engineer. I post here very often, fields of interest lies in android programming, web development and UI/UX designing. Follow me to get the latest updates ;)

Leave a Reply

Your email address will not be published. Required fields are marked *