views:

111

answers:

2

I'm currently involved in an android application whose basic purpose is to upload large media files. What is difference of using HttpClient for uploading large files over using plain sockets in Android ? From what I had researched I found out that in order to send large files to server I need to use 'multipart POST' but it seems it is possible without it as well using plain socket ?

+1  A: 

The obvious difference is that HttpClient would handle HTTP headers for you (and this isn't as trivial as it may seem, as some returned headers may require client side work).

Ofir
+1  A: 

If you open a raw socket, you aren't necessarily using HTTP as your protocol.
So the question is where are you uploading the media files to ?
If it's a web server that expects HTTP POST messages you should obviously use HttpClient because it will do the dirty work for you. If it's an application that you are designing yourself, you can decide the protocol and use sockets.

Itsik