Hello,

I'm having a strange problem with my g1. I have ssh installed.
When I scp a 1MB file it takes ~3-4sec.

my app takes a photo, stores it the sdcard, and then on callback
uploads it to a server for processing.

When I try and upload to the same server (HTTP) with my app it takes
longer than 20 minutes. Incidentally when I try on my emulator to an
http server on my pc, I do not run into this problem.



I initiate a new  thread that handles upload after picture callback.
Things I've tried:

1.) I've tried setting this thread to the highest priority.   ( within
run() )
Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);

2.) I've set a wakelock around this code to ensure that the CPU is
still running.

3.) Sniffer on the server indicates that the upload starts off pretty
quick and then tapers off.

Any other ideas?


~~~~

          HttpClient httpClient = new DefaultHttpClient();
           HttpPost request = new HttpPost("http://example.com";);
           String existingFileName = "/sdcard/dcim/Camera/photo.jpg";
           File photo = new File(existingFileName);

           FileInputStream fileInputStream = new FileInputStream(photo );


           FileBody fileB = new FileBody(photo);
           InputStream ins = new ByteArrayInputStream(fileInputStream.toString
().getBytes());


           // create the multipart request and add the parts to it
           MultipartEntity requestContent = new MultipartEntity();
           requestContent.addPart("ufile", fileB);

           // execute the request
           request.setEntity(requestContent);
           HttpResponse  httpres= httpClient.execute(request);

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to