title: How to compress photo taken by Camera.takepicture
body: <p>I'm developing an app where the user has the ability to take a picture through my CameraActivity (SurfaceView+Camera) and save it. After that the bitmap will be processed. </p>
  
  <p>Said that let me walk you through details.
  The picture is taken with:</p>
  
  <pre><code>mCamera.takePicture(null, null, new PictureCallback() {...}
  </code></pre>
  
  <p>I'm not specifying .jpeg quality.<br>
  Testing with HTC One S, the picture is taken and then saved. The picture size never exceeds 100kb<br>
  Testing with Samsung GT-I9000, the picture is taken and then saved but the difference here is the size, it exceeds 1,2Mb.</p>
  
  <p>Since I'll need to process the bitmap latter on I'm having some <strong>OutOfMemory</strong> issues with the GT-I9000 when I try to decode the bimap to process it:</p>
  
  <pre><code>try {
      FileInputStream fis = new FileInputStream(new File(imagePath));
      Bitmap savedPicture = BitmapFactory.decodeStream(fis);
  </code></pre>
  
  <p><br>I've tried to change <code>Camera Parameters .setJpegQuality(quality)</code> but I it didn't made a huge difference.</p>
  
  <p>The image will occupy all the screen size and I used this approach <a href="http://developer.android.com/training/displaying-bitmaps/load-bitmap.html" rel="nofollow">Loading Large Bitmaps Efficiently</a>
  It worked, I got rid of <strong>OutOfMemory Exceptions</strong> but still I've some questions:</p>
  
  <ol>
  <li><p>File size differences between devices? I assume HTC One S is better than GT-I9000 so why doesn't save bigger pictures?</p></li>
  <li><p>Image resolution, HTC One S 640x480, GT-I9000 2560x1920 why? Well this answer the first question, but why is this happening?</p></li>
  </ol>
  
  <p>Thanks for your time ;)</p>