I have been struggling with creating a camera preview with a custom layout/overlay that mimics the functionality of the native camera app.
Is there any way I can simply constrain the size of the native camera preview and possibly overlay a grid image on top of it without having to fully rewrite all of the camera's functionality?
No. You cannot hack the UI of another app, any more than another app can hack your UI.
Also, bear in mind that there is no single "native camera app". There are dozens, perhaps hundreds, across the thousands of Android device models.
Related
I am fairly new to Android and especially to the various camera systems in this platform. I'm building an app where I need to integrate ARCore only to track the camera pose (among other things like objects in the scene, planes etc). I don't want to augment anything in the "real world" , so I am not looking to preview the frames being fed to the camera. I've looked through all of the examples in the arcore-sdk and sample code in google's documentation. None of them cover my use case where I want to be able to fetch camera's pose without previewing the camera images onto a surface view or something. I also don't want to 'fake' it by creating a view and hiding it. I would like to know if anyone has experience with such a thing or any ideas how we can achieve it or if we can achieve this at all? Does ARCore even support this?
UPDATE: I found this https://github.com/google-ar/arcore-android-sdk/issues/259 where they mention that it's possible with just an OpenGL context. But I have no clue how to get started. Any samples or pointers would be appreciated!
You can run an ArSession for tracking. ArSession doesn't depend on View.
Is there a way I can get an image from a camera preview? The purpose of this would be to overlay an emoji over the face of the camera preview, and I can't overlay the emoji images without first having a Bitmap image as follows:
private void processAndSetImage()
{
mResultsBitmap = OverlayEmoji.detectFacesandOverlayEmoji(this, mResultsBitmap);
mImageView.setImageBitmap(mResultsBitmap);
}
Is there a way that mImageView could have the value of a camera preview? Any links to other SO posts, or articles (in java) would be greatly appreciated!
Is there a way I can get an image from a camera preview?
No.
First, there are thousands of Android device models. These devices will have dozens, if not hundreds, of "android native camera" apps, as many device manufacturers frequently ship a customized camera app.
Second, there is no requirement that all camera apps have an identical user interface. The size and position of the camera preview can vary. Not only will they vary between apps, but even the same app might vary the size and position of the camera preview between versions of that app, as apps can and do get updated.
Third , you have no good way of determining when any of these camera apps happens to be in the foreground.
I am working on an Android app mainly based around the camera of the device. I am able to launch and use the Camera Intent but I would like to know if there is a way to customize this camera screen. I mean, for the moment, the camera preview screen displays all the settings of the camera, I would like to be able to hide them. If possible, I would also like to add new buttons on this screen, so I could launch popups or display a message to the user. Is it possible or should I try to use an external library which handles that ?
Basically, I would like to have a camera screen which would look like the one from the Snapchat Android app.
Thanks!
I would like to know if there is a way to customize this camera screen
No. After all, there are several hundred possible applications that you could be launching, and none of them have to offer any sort of API for the control that you want.
I would like to have a camera screen which would look like the one from the Snapchat Android app.
Then use the camera APIs directly (e.g., android.hardware.Camera) and write your own camera app.
so I need to modify certain properties about the way this app is taking/processing a picture. Yet, I would like to just use the standard buttons that the android has for taking pictures, so that i don't have to code them all myself. is this possible when doing such with a surface view and the Camera API? like, zoom, flash, choose camera, and such
we are developing an Android App to be used on 1 of 2 Android cameras. Specifically the Nikon S800C.
We are able to use digital zoom but as yet we have not found a way of handling the hardware zoom which is the whole point of using a camera rather than a basic smart phone.
We cannot use the internal camera app as we have to make a custom camera overlay and preview screen. As such we have had to compose our own camera app.
It seems from what I have been advised it is not technically possible to control the camera hardware zoom from within our own app.
So my question is: Is this really the case? Is there absolutely no way of building a custom camera app that has a custom camera capture experience and also a camera HARDWARE zoom?
If this is the case, is there a way of creating a custom preview and camera overlay screen for the existing internal camera app on our device? Which would negate the need to build our own.
Thanks.