In my opinion, the solution to the mixture should be better. Why is this? Because you do not know or believe that in most contexts you cannot know how and how many contacts you will need the application to display . Also, how many contacts are stored on the phone. If we know both answers, we can certainly make the most appropriate decision.
So, I suggest you first bring a fixed number of contacts, using an array in memory in the background thread, for example the first 20. Also, if you think that your application will make more than one request to this service. it will be awesome to use some kind of caching. The worst approach should be to call the contact service again and again. Then, to request contact 21, you can enter the following 20, and so on.
Thus, you can take advantage of both worlds and minimize disadvantages. It always depends on the application and the context we are talking about.
matiasnj
source share