ACTION_VIDEO_CAPTURE automatically start - android

In my App I use ACTION_VIDEO_CAPTURE to record video.
But Now I have to start record when I start Activity.
How ro start ACTION_VIDEO_CAPTURE and start recording automatically?
Or if it's impossible how to add listener to record button (ACTION_VIDEO_CAPTURE) or check when this button was clicked?

How ro start ACTION_VIDEO_CAPTURE and start recording automatically?
You don't. There is nothing in the ACTION_VIDEO_CAPTURE protocol that allows you request, let alone control, how the third-party camera app allows the user to start and stop the video.
how to add listener to record button (ACTION_VIDEO_CAPTURE) or check when this button was clicked?
I do not know what "record button" you are referring to. If you are referring to a button in the third-party camera app, there may not be a button. The third-party camera app may use a tap on the preview image, or a gesture, or a timer, or whatever the developer of the third-party camera app wants to do. Moreover, all of that is inside the third-party camera app, and you have no good way of finding out when those events occur, if at all.
If you need this level of control over video recording, record the videos yourself using MediaRecorder.

Related

Launch default camera app and start record automatically

I have a button in my app. With an OnClick event to the button I launch the default camera app.
public void startrec(View v) {
Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
startActivity(intent);
}
This works fine. Now is it possible that the camera starts recording automatically without I have to press the record button in the camera application? So I mean... I press my button in my app -> the camera app starts -> the record starts immediately
How can I do that?
How can I do that?
Record the video yourself, using classes like MediaRecorder.
Your existing code is asking a third-party app to take a video on your behalf. There are hundreds, perhaps thousands, of such apps. The behavior of each of those is up to the developer of those apps. There are no documented extras for your chosen Intent action, let alone one for your desired feature. And even if it existed, not every camera app would honor it.

Is it possible to start custom glassware using camera button in google glass?

The Google glass contains a camera button at the top. By default it invokes the default Google camera app and captures the picture in a single click.
If my app is running, I can receive the camera button pressed event by overriding onKeyDown() in my app.
My question is, how can I make the camera button to start my app at first hand?
Also how does the Google camera app gets started when the camera button is pressed and how is the event again passed to onKeyDown()?
There is currently no way for a Glassware other than the built-in Camera to get started when the camera button is pressed on the timeline.
If you would like such a feature, please file a feature request in our issues tracker and explain your use-case so we can properly triage and prioritize.

Android: Start recording video with the activity without any kind of user interface with specified size and quality

I want to start video recording immediately with a shake, preferably without turning on the screen or showing anything on screen (no user interface except shake to start recording). Can anyone provide an example?
I am currently at the point where shaking device starts my videorecord.class activity. I want to include "no interface video recording" within this activity.

is it possible to programmatically call the capture button on a camera intent from its calling activity

I am using some voice recognition on my activity. I have it set to open the camera intent using voice commands, but I'd also like to be able to have it snap the picture via voice. I know I could write this up using the camera object, but I'd rather keep using the intent because it offers more bells and whistles when not using voice.
I'm pretty sure this isn't possible but I'd love to be wrong here. Is there a way to call the capture button on the camera intent programmatically so I can leverage the voice commands to capture my image ie...if I say "take picture"...bam, picture is taken.
Ultimately, I'd also need to be able to programmatically hit the "confirm" button on the intent after the image is captured (or the cancel button), and then have it return to my calling activity.
It is not possible. You can't control other apps. The Intent is just a messages/event. When your app sends some Intent other app could receive it and decide what to do.
I think that the only way is to implement your own camera. By the way there are lots of open-source camera apps. For instance: https://github.com/CyanogenMod/android_packages_apps_Camera.

How to auto start capturing of picture using native camera

Upon starting my Android app, I want to auto start the native camera (can be done using intents) and start taking pictures automatically for every few seconds.
Can this be done? After starting the camera, how do I initiate this? So that user need not click anything to start the photo taking process.
Thanks In Advance,
Perumal
There is no support in the camera intents for autocapture. If you want to do that you'll need to actually implement the camera code within your app.
If you are using intent, you just fire up installed camera application and have no firther control. If you like to capture images periodically and be in control, you have to use camera service yourself. Here (in source repo) you can find a sample how to fire up camera and capture previews:
http://sourceforge.net/projects/javaocr/
Keep the button there but set the visibility to gone so that user doesn't see the button.
When you open the camera, use a timer task and then inside the timer task just write:
button.performClick();
here button is the reference to your Button or whatever view you are using.
This will capture images automatically, after the time specified by you.

Categories

Resources