title: Handling large bitmap
body: <p>I just want to open native camera app from my app to capture a photo and set it as a background image of my screen then rotate it onclick of button. Photo is rotating n number of times if it is taken with 3MP camera. If I set camera resolution to 5MP or more, app is force closing on click of button 5th time (photo is rotating 4 times).</p>
  <pre><code>Bitmap rotatedBitmap = null; 
  int curAngle = 0; 
  
  private Bitmap rotateImageBitmap(Bitmap capturedPhotoBitmap) {       
  
  if(rotatedBitmap != null  ) 
  { 
      rotatedBitmap = null; 
  } 
  
  Matrix matrix = new Matrix(); 
  curAngle = (curAngle + 90) % 360; 
  matrix.postRotate(curAngle); 
  rotatedBitmap =  Bitmap.createBitmap(capturedPhotoBitmap, 0, 0,  capturedPhotoBitmap.getWidth(),  capturedPhotoBitmap.getHeight(), matrix, true); 
  
  return rotatedBitmap;         
   } 
  </code></pre>
  <p>This is from Developer Guide ....<br/></p>
  <p>1.
  Mobile devices typically have constrained system resources. Android devices can have as little as 16MB of memory available to a single application.</p>
  <p>2.
  Bitmaps take up a lot of memory, especially for rich images like photographs. For example, the camera on the Galaxy Nexus takes photos up to 2592x1936 pixels (5 megapixels). If the bitmap configuration used is ARGB_8888 (the default from the Android 2.3 onward) then loading this image into memory takes about 19MB of memory (2592<em>1936</em>4 bytes), immediately exhausting the per-app limit on some devices.</p>
  <p><b>Most phones nowadays have cameras 8mp or higher. So pictures will be large.</b>
  How can I rotate my photo 'n' number of times without bothering of camera resolution. Do I need to compress it? What is the best way?</p>