I need camera to appear in particular screen area in android here is the code that I use for camera activity
Now camera is working but it occupies whole screen I want camera to appear in particulat area of screen how to do this??
private void uploadPhoto(String name) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory(), name
+ ".jpg");
mImageCaptureUri = Uri.fromFile(file);
try {
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
mImageCaptureUri);
intent.putExtra("return-data", true);
startActivityForResult(intent, PICK_FROM_CAMERA);
} catch (Exception e) {
e.printStackTrace();
}
}
You cannot use an intent for this. If you use an intent, it wil launch the camera app. Instead, you need to use something called a Camera Preview. This will show what the camera sees to the user and you can then use API’s to control the camera actions.
here is a very nice tutorial for this from the official developer docs:
https://developer.android.com/guide/topics/media/camera.html#custom-camera