Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
If you are facing any issue in playing video please use Firefox browser.
Creating Camera Application
In this video we are going to create Camera application in Android.
First of all we will design the layout of our application, for that we will open activity_main.xml file and imside that we will take one Relative Layout, Button, and an ImageView.
Now we will see the Java code of this application in MainActivity.java file,
public class MainActivity extends Activity
private static final int CAMERA_REQUEST=1888;
public void onCreate(Bundle savedInstanceState)
Intent cameraIntent=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data)
Now we will execute our code, and we need to run this application in a real device, not emulator. So for that we will connect one device and use it to run our code. As soon as we run our code, it executes properly. Camera captures image first and then show it's preview to us.
Have a friend to whom you would want to share this course?