So as of now, our app displays only one quote. Now we need to make it display multiple quotes (say 10), we have to call the API with second parameter as 10 and make little changes to our data model and repository classes. Before we do it, I want you to imagine kind of changes you would require to do if you don’t use the current architecture which we are using. First of all, you will have to change the API call (which will be ultra easy in our case, thank you Retrofit), then changes in DBHelper classes
Continuing from last article, we need to implement some mechanism for caching the quote offline so that whenever user will open the app, he will see last quote loaded without waiting to load new quote and in background we will request server for new quote and update the UI whenever data is available. We are going to use Room Persistence Library for that!
Continuing from the last article, for fetching quotes for our app, we are going to use Retrofit and fetch quotes from this simple and free API Random Famous Quotes API. API is straightforward and simple GET request for getting single quotes from movie category will look something like this where count parameter is optional and…
Our basic requirement is the app which will fetch me a new Quote from mentioned category every time I open it. But while fetching, we should not be kept waiting and instead be presented with the last quote which we fetched.
Google has introduced new exciting Android App Architecture Components in this years I/0. I have been playing with those since the day they were announced and excited to share with you my experience with them! Great Android App is every Android Developers dream!