C
C
Che_Bu_Rashka2015-12-16 13:46:42
Android
Che_Bu_Rashka, 2015-12-16 13:46:42

How to transfer a large amount of data to the server from an Android device?

I wrote an application that should transfer photos taken on the device to our server. For transmission, we use the library for asynchronous transmission of http-post requests - Android Asynchronous Http Client . The library is great! Faced such a problem - when a user sends several files (it turns out in parallel), then if he does not have a very good connection, the sending fails for some connections and an error is returned, and some leave. There are two questions: 1) is it generally the right approach to send photos through post-requests? 2) how to overcome the problem? There are thoughts of somehow setting up crutches and forcing the library to transfer in turn, but I understand that this is horror and terrible heresy. How would you do it if you still needed the http protocol?
PS I do not want to refuse the library, as it allows you to make a convenient Progress Bar to track the number of bytes transferred.

@Override
 public void onProgress(long bytesWritten, long totalSize)
Now just saw Class SyncHttpClient . I'll try to use it. But it's still interesting to know how you would do it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
z0rgoyok, 2015-12-16
@z0rgoyok

Any http library + queues

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question