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();
}
}
On your phone, open the Settings app. Tap Privacy. Turn off Camera access or Microphone access.
Tap the app drawer icon. It's the icon made of 6 to 9 small dots or squares at the bottom of the home screen. This opens the list of apps on your Android. If you see the Camera app on the home screen, you don't have to open the app drawer. Just tap Camera or the icon that looks like a camera.
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
You are opening the default camera app when you are using the camera intent. But if you need to display camera in a particular part of the screen you should consider making your own camera application. Read here for more http://developer.android.com/guide/topics/media/camera.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With