title: Take a picture from an Android Activity "as a Service"
body: <p>I want to take a picture from a non-activity Thread (a web server running on the device).</p>
  
  <p>In order to do this, I wanted to have a Service bound to the Application, that I could call which would take a picture, and return the Bitmap when done. But it looks like I can't do that because for security purposes Android forbids to take picture without showing a preview (even with a dummy preview <a href="https://stackoverflow.com/questions/9744790/android-possible-to-camera-capture-without-a-preview">like shown on the accepted answer here</a>, on some devices)</p>
  
  <p>I then wanted to have an Activity that takes the picture for me, with a real preview, but I can't think of any way to do this either because:</p>
  
  <ul>
  <li><p>I can't get the Bitmap back because I can't call <code>startActivityForResult()</code> as my web server is not an Activity, so I can't override <code>onActivityResult()</code>. (The webServer just has a reference of the instance of the Application)</p></li>
  <li><p>I can't just pass the HttpRequest along with the Intent for the Activity to respond to it, because the Response object is not parcellable?</p></li>
  </ul>
  
  <p>How would you do something like that in the most logical/elegant way possible?</p>