When using ACTION_IMAGE_CAPTURE with android Intent:
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
intent.putExtra(MediaStore.EXTRA_OUTPUT, it.uri)
intentLauncher.launch(intent)
My app opens camera activity as expected, but it seems to be a dumbed-down version of the original camera app. For example on my Samsung S20+ device, I do not get the ability to scan documents when taking pictures, and if I go into settings of launched activity, Intelligent features are disabled and it says that "Intelligent features only work with the rear camera in Photo mode"
If I use INTENT_ACTION_STILL_IMAGE_CAMERA, then all the intelligent features work, but this mode doesn't return me back to my app after taking a picture.
Is there a way to achieve ACTION_IMAGE_CAPTURE with enabled additional camera features?
Related
In my app I take a picture by using a Camera intent. When the intent is opening the Samsung default camera app the camera app does not show the photo modes it shows when opening the app directly, like Portrait, Fun, Pro, Panorama, Food etc.
I know that the Intent will open the default camera app, which could be any camera app, but in this LoB app user's mostly have Samsung phones, so is there some "magic" extra information I could pass to the intent so that Samsung's default camera app would show these modes when opened by an intent?
I'm working on Android application that capture images and upload this images to a server.
I used intent to open the camera:
val cameraIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
I need to open the camera in landscape orientation, I tried this approach and nothing changed
cameraIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
Any advice please.
The behavior of the camera app is up to the developers of the camera app. There are hundreds of camera apps, both pre-installed and user-installed. EXTRA_SCREEN_ORIENTATION is not documented as being part of the ACTION_IMAGE_CAPTURE protocol, and I am not aware of any camera apps that would honor it. There is no requirement for any camera app to let callers force a screen orientation.
You could integrate a camera library (CameraX from Google, etc.) and take photos yourself directly in your app. Then, you would be able to control the orientation of your screen (e.g., via android:screenOrientation in the manifest).
I'm developing an app on Android Studio and I am setting a button that, when pressed, will open the camera. In particular, I need the camera to take multiple shots (keeping the "shot" button pressed on the camera view, it should take multiple shots till it is released).
My smartphone camera supports the "continuous shot" feature (Android 5.1, API 22), but I cannot use it when I call the camera from my app. As you can see in the screenshots below, when I open the camera from the official camera app, it has a different layout with more settings. When I call the camera from my app, it has less settings and if I try to keep pressed the "shot" button, it appears the toast message "Does not support continuous shot".
https://i.imgur.com/ncaJYyz.jpg
https://i.imgur.com/IJMIqjf.jpg
The simple code I use to call the camera function in my app is the following:
public void cameraCall(View view) {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, 0);
}
Any idea about how to solve this problem?
Thank you
When you use IMAGE_CAPTURE intent, Android launches some camera app on your device. Most often, this will be the Camera app that was preinstalled by the device manufacturer, but this could be an 3rd party app installed from the Play Store or even sideloaded. This Camera app declared support for this standard intent, and hopefully it honestly fulfills the contract defined for this standard intent. This contract does not mention many advanced features of the cameras, so most likely you will not get them.
You may find another intent, INTENT_ACTION_STILL_IMAGE_CAMERA, better fit your needs. Or you can launch default camera app on press of the button.
The alternative is to implement custom camera in your app.
i am making an app in which i want to capture image in default camera app without pressing capture button.i also tired this but it just open camera app.
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
i am making an app in which i want to capture image in default camera app without pressing capture button
That is impractical, sorry.
First, there is no single "default camera app". There are ~2 billion Android devices in use, spanning thousands of models. Those models ship with hundreds of "default camera apps".
Second, there is no requirement for a camera app to have a capture button. Some might take a picture by other means. Even for those that have a capture button, there is no requirement for it to have anything in common with capture buttons in other camera apps.
Third, outside of accessibility services and rooted devices, an app cannot fake user input into another app.
You are welcome to write your own camera app, using the camera APIs (android.hardware.Camera, android.hardware.camera2.*), and come up with your own trigger for when a picture should be taken.
I need to slightly modify the default camera intent in android - for example I want to start the camera in 360p quality, when starting front camera to be the active one and to be oriented in landscape. I have done a research and find some put extra options that could be used but it seems they do not work properly. So i think that the best way to do this is to find the build in camera intent code and do some modifications.
Where I can find the source of the build in camera intent and also the meta data part in the manifest(if there are some specific options to start the intent)?
I need to slightly modify the default camera intent in android - for example I want to start the camera in 360p quality, when starting front camera to be the active one and to be oriented in landscape.
I am going to guess that by "default camera intent" you mean an Intent for ACTION_IMAGE_CAPTURE.
I have done a research and find some put extra options that could be used but it seems they do not work properly.
For ACTION_IMAGE_CAPTURE, there is no extra to force 360p, and not all cameras support that resolution. There is no extra to force a front-facing camera, and not all devices have a front-facing camera. I am skeptical that EXTRA_SCREEN_ORIENTATION will do what you want, and there is no requirement that any camera app must support EXTRA_SCREEN_ORIENTATION.
So i think that the best way to do this is to find the build in camera intent code and do some modifications.
I am going to assume that by "build in camera intent code" you mean "built-in camera app".
Where I can find the source of the build in camera intent and also the meta data part in the manifest(if there are some specific options to start the intent)?
Few manufacturers ship the AOSP camera app. They replace it with their own. The source code for their own camera apps will be in their offices.