P
P
prizrak392017-04-21 20:02:25
Java
prizrak39, 2017-04-21 20:02:25

How to properly upload multiple files to the server?

Hello.
An Android application requires a service to download files. If I understand correctly, then the method for multi-uploading files will not return a response to the application side until the files are saved on the server.
Is it possible to organize the download of files in the background so that the mobile application does not freeze.
The second question, if it is possible, is how to properly organize the transition to another screen if, for example, the background process of downloading files has not yet been completed.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Myvrenik, 2017-04-21
@gim0

Is it possible to organize the download of files in the background so that the mobile application does not freeze.

Perhaps any long-running tasks such as HTTP requests, working with files or databases should be done asynchronously, i.e. in a separate thread. Popular HTTP clients like OkHttp make this quite easy . By default, Android should not allow HTTP requests from the main thread, in principle, just so that you don’t make a mistake and lock up the interface.
Yes, you need to download in the service , it works in the background.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question