I'm having this error while downloading a webservice object that has images that are converted to base64. The question is that if this object is already saved in the local android database the app works, I get load many objects at once and show on the screen, but now I'm downloading from the webservice these object, down one by one, and some are giving this error due to the amount of images they have.
I do not understand why if these objects are already in the cell the memory does not burst, now when I download it happens.
This happens only in the Android 2.3 emulator. in the upper run normal. I can even download an array with all the objects and their images.
Method responsible for downloading
public class Sincronismo {
public static String GET(Context context, String endereco){
//Verifica se existe conexão com a internet
if(!existeConexao(context))
return K.FALHA_CONEXAO;
InputStream inputStream = null;
HttpClient httpClient = new DefaultHttpClient();
String result = K.FALHA;
try{
HttpGet httpGet = new HttpGet(endereco);
HttpResponse httpResponse = httpClient.execute(httpGet);
inputStream = httpResponse.getEntity().getContent();
if(inputStream!=null)
result = inputStreamParaString(inputStream);
else
result = K.FALHA;
}catch(UnsupportedEncodingException e){
e.printStackTrace();
}catch(ClientProtocolException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
return result;
}
private static String inputStreamParaString(InputStream in) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line="";
String result="";
while((line = br.readLine())!=null)
result += line;
in.close();
return result;
}
}
This is the method that downloads, I leave here to analyze