简体   繁体   中英

Load all data of each item in list view or only needed information?

In my android app, I have a list view and a detail view for selected item. I retrieve the items from my backend server using retrofit.

But is it better to retrieve first the needed information in list view and then to retrieve all the data of selected item in detail view. Or is it better to load all the data of each item directly in the list so that the user does not wait when he selects an item ?

It really depends on the type of item you use

To take the extremes :

if you have a list of songs, you don't want to load the entire song data while loading the list. You just want the title, author, eventually the length and when you click on it to show details, you will load the song at that time or it will that a long time to load the list and you will not have enough memory.

On the other hand, if you have simple items (for example books) where you show the title in the list and the only informations you need is the author and editor, you can load everything in one request.

Things to consider :

  • Your internet speed
  • the size of the item compared to the size of the data displayed in the list
  • the size of the list

From a UX view, it's not satisfying to force your users to wait throughout your application process, it's better to wait on time for all.

From a performance view, each request call has its overhead (ie network load),so going for a large request is faster than many small requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM