title: Encoded byte64 image causes OutOfMemoryError android
body: <p>I'm getting quite crazy with this issue:</p>
  
  <p>I am getting an OutOfMemoryError everytime I open my app. At some point, it loades an image from a server, but it's encoded y a Base64 string. </p>
  
  <p>Whay I do is basically:</p>
  
  <pre><code>decodedString = Base64.decode(imagen_codificada);
  
   Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, 
                              decodedString.length); 
  </code></pre>
  
  <p>But i'm getting the damned OOME, everytime. </p>
  
  <p>If tried with this:</p>
  
  <pre><code>BitmapFactory.Options options=new BitmapFactory.Options();
                          options.inSampleSize = 8;
  </code></pre>
  
  <p>Even setting options to 128, what is crazy, but still crashes...</p>
  
  <p>Is there a way to reduce the size of the String codifying the image somehow before decoding it? I can't operate straightly with the image, because it's used for many other things withing the app and in desktop environments...</p>
  
  <p>I attach the ERROR log:</p>
  
  <blockquote>
    <p>12-21 10:36:27.032: E/dalvikvm-heap(5508): 10119168-byte external
    allocation too large for this process. 12-21 10:36:27.032:
    E/dalvikvm(5508): Out of memory: Heap Size=5823KB, Allocated=4351KB,
    Bitmap Size=720KB, Limit=13692KB 12-21 10:36:27.032: E/dalvikvm(5508):
    Trim info: Footprint=6343KB, Allowed Footprint=6343KB, Trimmed=520KB
    12-21 10:36:27.032: E/GraphicsJNI(5508): VM won't let us allocate
    10119168 bytes 12-21 10:36:27.192: E/AndroidRuntime(5508): FATAL
    EXCEPTION: main 12-21 10:36:27.192: E/AndroidRuntime(5508):
    java.lang.OutOfMemoryError: bitmap size exceeds VM budget</p>
  </blockquote>
  
  <p>EDIT: SOLVED WITH THIS:</p>
  
  <pre><code>decodedString = Base64.decode(imagen_codificada);
                      System.gc();
                      BitmapFactory.Options options=new BitmapFactory.Options();
                      options.inSampleSize = 8;
                      InputStream input = new ByteArrayInputStream(decodedString);
                      Bitmap decodedByte = BitmapFactory.decodeStream(input, null, 
                              options); 
                      menu.setNombreApellido(decodedByte);
  </code></pre>
  
  <p>Thanks to everyone!!</p>