2

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.

user1160711
  • 463
  • 1
  • 5
  • 11
  • I am also exactly seeking for the same solution. Here is my question posted here for bounty: http://stackoverflow.com/questions/20684553/how-can-i-enable-my-android-app-to-take-pictures-from-the-camera-without-preview – Muhammad Maqsoodur Rehman Dec 21 '13 at 16:41

2 Answers2

2

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

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!

mfsiega
  • 2,852
  • 19
  • 22