Reputation: 5155
According to Yigit Boyar excellent talk at Google IO 2016, the Mobile App should be usable whether online or offline. On top of that, the data should only come from disk (local storage) to display on screen.
Currently I am implementing e-book store Android app. In my App, I would like to pull data from network about 10 books to show in the list (RecyclerView
).
With endless scrolling feature (like Facebook), the app will pull more data from the network when the user scrolls down to the end of the list.
If I keep all the data in local storage (sqlite database
), the database will be loaded with thousands of records of books eventually.
Is it normal to store thousands of records in the local storage just only for offline support?
So should I keep the data in Local Storage according to Yigit Boyar's guidelines? Or is it enough to be based on Network cache (references by this article)?
Is there any other solutions that you would like to suggest for my scenario?
Upvotes: 0
Views: 244
Reputation: 13865
It is essential to provide local storage for the eBooks, as the users can read at anytime and anywhere once they downloaded the book.
You can separate the eBook data into two: one for the list and other for detail, in a way that the data for the list is as minimal as possible -- only the required fields for the list. Only if the user clicks on a book and goes to the detail page, download the entire data of the single book.
So storing 1000s of books data wouldn't take more storage as you are storing only minimal data required for the list.
And you can purge the old data based on Least recently accessed books after a certain time period, say, every week or month.
Upvotes: 1