What is the best way to send a big file from an Android App to a distant server ?
Since there is one thread for the UI, I would like to keep 1 thread for the network connection (SFTP protocol) without reconnecting at every file I send. * AsyncTask is bad because the operation will last way too long and the UI will freeze. * IntentService is not the best since it has to reconnect for every file (when the Thread ends, it auto disconnects and I don't see how to keep the connection open).
Something nice would be : 1 thread for the UI, 1 thread to keep the connection open, 1 other thread for downloading/uploading to the server. Maybe with a standard Runnable class ?
Thanks in advance !