Hi guys!

I've already posted this question on Stack 
Overflow: 
http://stackoverflow.com/questions/21932685/httpurlconnection-slow-post-multipart-content

But maybe here I can find more solution :)


I'm trying to post a test File to a tomcat server using Android. I'm 
developing on Android 4.1.2, but I have verified same problem on 4.0.3.

The problem is that the file upload requires a very long time (about 70 
seconds for a 4MB file), also in local network. The time is equiparable 
using a 3g connection. I've excluded that it could be a server problem: 
executing the same call with curl it takes 1 / 2 seconds.

I'm using Spring Android RestClient 1.0.1.RELEASE and, given Android 
version and the fact that I'm not overriding default behaviour, it uses 
HttpUrlConnection instead of HttpClient to make http requests.

I have also implemented my custom ClientHttpSessionFactory in order to 
manipulate some details of SSL connection and I have defined my own 
implementation of ClientHttpRequestInterceptor in order to modify 
authentication header.

All works, also the posting of small file. But when I try to send "big" 
files the time increase.

I have also set setBufferRequestBody(false) in order to avoid 
OutOfMemoryException on big files. But this property have no effects on 
time required.

Looking in DDMS shell, on Network Statistics I've also found that the 
network throughput is never over 250kb in TX. 

There seems to be a bootleneck, but how to investigate it?

I can post some code if it could be useful!

Thank you for any suggestion! 
Marco

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to