Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
In this video our topic is Camera API.
A quick way to enable taking pictures or videos in your application without a lot of extra code is to use an Intent to invoke an existing Android camera application.
To use Camera Intent our first step is to create a Camera Intent. we need to create an intent that requests an image or video using one of the intents MediaStore.ACTION_IMAGE_CAPTURE and MediaStore.ACTION_VIDEO_CAPTURE to request image or video from an existing camera application.
To start the Camera Intent, we will use the startActivityForResult() method to execute the camera intent. After you start the intent, the Camera application user interface appears on the device screen and the user can take a picture or video.
Now to receive the Intent result, we need to set up an onActivityResult() method in your application to receive the call back and data from the camera intent. When the user finishes taking a picture or video, the system calls this method.
Other features if we talk about are,
android.hardware.camera to use Camera hardware
WRITE_EXTERNAL_STORAGE to store images or videos in external storage.
RECORD_AUDIO is needed when recording video with Audio.
Have a friend to whom you would want to share this course?