title: Take and save picture on button press
body: <p>I'm creating an Android application which uses user captured images as part of a larger process. So far my XML layout has a SurfaceView and Button inside a RelativeLayout. I've managed to get the camera preview to show on the SurfaceView but I'm stuck on how to take a picture and save it when a user presses the button.</p>
  
  <p>My class file looks something like the CameraPreview API demo:
  <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html" rel="noreferrer">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p>
  
  <p>Ideally, when the button it pressed the camera should autofocus, snap a picture (with the clicky sound), save it to <code>/data/data/app_package_structure/files/file_name.jpg</code>, then pop up a Toast to tell the user their image has been saved.</p>
  
  <p>Any help is much appreciated :)</p>