user1160711
user1160711

Reputation: 463

Can I tell the camera to just go ahead and take the picture?

I've whipped out an app using the sample code in Take Pictures Simply, but all it does is start the camera app, at which point I still have to press the take picture button and then say "yep, that picture I took was OK". Is there anything extra I can put in the Intent to say "just go ahead and take the dadgum picture using the settings I saved the last time I was in the Camera app"?

I want to be able to trigger taking the picture remotely and I'd rather not build a whole camera app from the ground up.

Upvotes: 2

Views: 135

Answers (2)

mfsiega
mfsiega

Reputation: 2872

This Android doc on "Controlling the Camera" discusses the details of actually controlling the camera within your app. As CommonsWare points out, the sample code you're using purely launches the camera App and then handles the result. The Camera API should give you access to all of the functionality you need. Make sure to set the right permissions/etc in your manifest!

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006944

Is there anything extra I can put in the Intent to say "just go ahead and take the dadgum picture using the settings I saved the last time I was in the Camera app"?

No, because the primary point behind starting a camera app via Intent is that the user can then use the preview on the screen to line up a shot. It's possible there are some third-party camera apps that might support some Intent extra for an automatic shot, but it is not part of the standard ACTION_IMAGE_CAPTURE protocol, and you cannot count on any given camera app supporting it. Also, bear in mind that the user might have more than one camera app installed, which means a chooser, not the camera app, will appear when you call startActivity().

If you want to control the actual taking of the picture, you will have to write something using the Camera class.

Upvotes: 2

Related Questions