title: Memory problems when posting files from android
body: <p>When I try to upload images or larger files from my android app it crashes with an OutOfMemoryException. Im wondering if there are any alternate ways of doing this. </p>
  
  <p>Ive had the application crash in two different spots:</p>
  
  <pre><code>Base64.encodeToString(bytes, Base64.DEFAULT);
  </code></pre>
  
  <p>And here where the base64 string is one of the values in the nameValuPairs collection.</p>
  
  <pre><code>HttpClient client = new DefaultHttpClient();
  HttpPost httppost = new HttpPost(uo.WebServiceURL);
  UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nameValuePairs); // On this line
  httppost.setEntity(entity);
  HttpResponse response = client.execute(httppost);
  </code></pre>
  
  <p>Any ideas? </p>