trenton-telge / Framer

Android TV Backdrop Service for Modern Art

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Image request daemon

trenton-telge opened this issue · comments

Every night, request new images and cache

Make actions in this class open a new thread when they start network actions, otherwise the app will have freezing issues when this is called from the settings or dreamservice activities.
Here is documentation on multithreading in Java: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html

The data should flow like this:

  1. App sends a request for the remote API to send the JSON list of image addresses and info
  2. JSON list is recieved by app and stored
  3. JSON list is split into string groups, and stored in RemoteImage objects
  4. RemoteImage objects, when created, are filtered. If the RemoteImage object author is also an author checked in the settings panel, it is added to a Results vector. If not, it is discarded.
  5. The Result vector is looped through, downloading the urls contained to local locations. The local path should be stored in the RemoteImage it corresponds to.

I can help with multithreading after this is done. None of this needs to directly modify the UI thread, so that should be fairly simple.