This is the first time I'm trying to take a photo using Phonegap and I've got a small issue!
I can take a photo using the cordova camera plugin which opens the default camera app on the device. This works!
However, I would like to take a photo silently. For example, show a page of text and take a photo programmatically without the preview/default camera app ever showing.
Is there a way to do this currently? I've even looked into taking a silent video in order to extract a single frame.
Something along the lines of this (Take a picture in iOS without UIImagePicker and without preview it) but within Cordova/Phonegap is what's needed.
if you want to take picture specifically or screenshot will do the work for you????? because there is already plugin available for screenshot in cordova which doesn't need user interaction.
Related
I'm learning android studio and I'm currently working on a robotics project in which an Android phone is placed on the robot and used as the processor, therefore I can't reach the phone by hand. The phone needs to do some image processing. And it's not a real-time processing so I need to take a photo (Preferably Bitmap) whenever I want, quickly and without preview and confirmation. I've tried some tutorials and they all open the camera app and the user needs to capture and then confirm the photo.
I don't have problem with the processing and I don't need to use openCV etc. I just need help with capturing the photo. Thanks
You can implement your own camera, either via the camera APIs (hard) or by using a library (CameraKit-Android, Fotoapparat, etc.), thank you will have control, you can directly save the image without previewing it
I'm working on a application and i want to take the picture of the user automatically with front camera without opening the camera or with a little preview.I can take the picture but the user have to click the button but what I want is it takes picture automatically. I've searched a lot about this but I was unable to get some useful tutorial or code.I
Using the camera API you can achieve this.
Look at this like http://www.vogella.com/tutorials/AndroidCamera/article.html
I am developing a Cordova camera plugin. When you open the camera, it allows the user to take the picture (first part) and then it takes the user to preview photo screen, where user can save or discard the image(second part). As per my requirement, I need to know when the user is at second part i.e. he/she is at 'save/discard' screen.
I was able to detect it in iOS via notifications. But I don't have any experience in Android so couldn't figure out a way.
Any help will be appreciated.
I am developing a Cordova camera plugin
According to your comment, you are using an existing Cordova camera plugin. I presume that you mean that you are forking that plugin and making changes to it.
That plugin is using ACTION_IMAGE_CAPTURE on Android to take a picture. This delegates to an external camera application. There are hundreds of possible camera applications that could handle the request. That includes pre-installed camera apps from thousands of Android device models.
I need to know when the user is at second part i.e. he/she is at 'save/discard' screen.
There is no requirement for developers of a camera application to offer the user a "save/discard" screen for ACTION_IMAGE_CAPTURE. Some may, some may not. For those that do, there is no requirement that they somehow tell other apps that the user is now on the "save/discard" screen.
Hence, there is no way for you to accomplish this, using the existing core logic in that plugin.
I'm using a chooser to allow the user to pick a photo from his gallery or take a new one using his camera (I copied the code from this answer).
Picking an image from the gallery works perfect. The problem is that when I capture an image with the camera It's not returning to the app and just stays in the confirmation screen...
I actually don't even need this screen to be displayed in the first place...
Can I somehow disable it or (if not) just make the Done button work?
Thanks in advance!
Can I somehow disable it
No.
just make the Done button work?
Contact the developers of your camera app, and point out the bug. Perhaps someday they will fix it.
You are using ACTION_IMAGE_CAPTURE. This launches a third-party camera app, to take a picture. There thousands of Android device models. These ship with hundreds of different pre-installed camera apps, and there are many more available for download from the Play Store and elsewhere. Any could be the one that handles a given ACTION_IMAGE_CAPTURE request, and any of them can have bugs.
Facebook Messenger lets you send pictures in a way that I haven't seen done in any other app before. Instead of opening the default camera-app or going full-screen camera, they open a camera-view in the space where the keyboard usually resides. Then you just touch an icon overlaid on the viewfinder to take and send the picture. Is it possible to do this using Cordova/PhoneGap?