• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps SQLite and UI update order on android?

Hello this is a simple design question for better practices:

Example and Context: I'm creating an app that shows a list of items in a players stash. For this i need following requests:

  1. Ask for all items IDS, one request.
  2. Look for each ID and inside each response i'll get the ICON link. As many requests as ITEMS here
  3. Request each ICON. As many request at items here.
All this will be presented on a Recyclerview list with cardviews and saved locally to the device database.

The question is: In which order should i do this???

Option A: get items IDs > Save to DB > Read DB > get ITEM OBJECTS > Save to DB > Read Database > GET ICON IMAGES > FILL UI LIST

Option B: get ONE item ID > get ONE item Object > get ONE item icon > present to UI > save Item Object to Database

ON both cases i will have timeout or try cach for items that fail to get. ON both cases in the future I will only request ICONs for existant items or full requests for new items in stash.

If you have another suggestion or approach feel free to add it.
 
Back
Top Bottom