Android: Using Camera API

In this tutorial, we will implement one simple camera app with following features:
1) Launch the camera app and it will start the camera with capture and exit button at bottom.
1) On capture, it will capture the picture and show it in ImageView.
2) If you press save, it will save the picture on SD card
3) If you recapture, it will again start the camera to take the picture.
4) If you exit the app, it will exit from the app.

Screenshot

Lets start by creating the project with name CameraApp with CameraAppActivity.

Define Layout XML file

Once the project with Activity, CameraAppActivity is created, first step is to create XML layout file. It is defined as follows:

[sourcecode language=”xml”]