I have this part in a service (or Thread same problem ) to load a file
greater then 400000 char;
almost 1/2 a mega char.
Some times it load much less not consistent.
How to debug it or make adjustment.
Same program download jpg (with modifications) of 30k without a
problem.
StringBuilder downloadFile(String url) {
final int IO_BUFFER_SIZE = 4 * 1024;
// AndroidHttpClient is not allowed to be used from the main
thread
// final HttpClient client = (mode == Mode.NO_ASYNC_TASK) ? new
DefaultHttpClient() :
final HttpClient client = (mode == Mode.CORRECT) ? new
DefaultHttpClient() :
AndroidHttpClient.newInstance("Android");
final HttpGet getRequest = new HttpGet(url);
try {
HttpResponse response = client.execute(getRequest);
final int statusCode =
response.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
Log.e("WindGraph", "Error " + statusCode +
" while retrieving file from " + url);
return null;
}
final HttpEntity entity = response.getEntity();
BufferedHttpEntity bufHttpEntity = new
BufferedHttpEntity(entity);
if (entity != null) {
InputStream inputStream = null;
try {
inputStream = bufHttpEntity.getContent();
>>>>>>>>>>> This is where content fails some time !!!!!!!!!!!!!!!!!!!!!!!!1
Log.d("WindGraph","Content size "
+Integer.toString( (int) bufHttpEntity.getContentLength()));
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en