Android Volley Multiple Requests in Parallel

Asked

Viewed 115 times

1

I’m developing an application where I have to make several Volley requests in parallel to fill out spinners, and there are two times I call this screen.

The first time is for a new registration, where all the features are in accordance with what I would like.

The second time is to edit the registration, where they should load the data of the spinneres and then fill in the value already pre-registered previously by the user. However, when trying to search the data and set in the spinner, the data have not yet been brought from the service.

I would like to know what is the best solution to accomplish this task... Vi some people talking about Asynctask, this would be the best option?

  • 2

    Put the code you’re using.

  • You want to solve the issue of not filling the spinner or you want a tip on how and what to use for web service consumption?

  • Both I’ve managed to accomplish... just wanted a hint on how to make several requests in parallel and qnd all are OK, I call the edit

  • I personally like the EventBus https://github.com/greenrobot/EventBus

1 answer

0

There are several ways to request a Web Services, through code that might make it too extensive or through some Apis. On the other hand, perhaps it is a little personal to choose a good tool to make requests, also for the sake of ease, practicality and documentation issues. One factor that should take a lot into account is the performance of your application, as the end user will be more satisfied by the fluidity of your application.

If you are using JSON, there are some frameworks that can help you a lot. See below the examples:

A gringo site made some experiments using these same frameworks, with a very basic application. The results are quite considerable because it shows the efficiency of each.

See below:

inserir a descrição da imagem aqui

To learn more about the tests, read the article Android Async HTTP Clients: Volley vs Retrofit

I find it interesting that you read the documentation of each one and make an analysis according to your development criteria, and of course, thinking about the end user and objectives of your project. After that, "taca le pau on those little fingers", #partiuprogramar #developepment #transformandocaféemcodigos.

  • So I really appreciate your answer which was quite thorough, but this is not the kind of problem I’m facing... My problem is that I make the various requests with Volley, only I needed the request response payload to be all ready for then call the function to fill out the edit fields

Browser other questions tagged

You are not signed in. Login or sign up in order to post.