I'm developing an app which will show some items in RecyclerView
by fetching JSONs from a web service. If a user scrolls at the end of the list, more data should be fetched. For the UI, I've implemented EndlessScrollListener, but I'm not sure what would be the right option for fetching actual JSON with a proper page index (e.g. http://some.service/data&page=1). To read data from an HTTP resource, I decided to use the Volley library. If I use just Volley itself it will be a problem to handle the onConfigurationChanged
event manually.
I know that AsyncTaskLoader
can help me to solve my problem, but it looks like it was designed to fetch data periodically. In my case I need to load data on demand (when user scrolls down).
I also thought about implementing sync adapter to fetch data, cursor loader and content provider to save/read data in offline mode, but it looks hard for me now, because I'm an Android novice.
What can you suggest?
I'm mostly interested in architectural part of solution.