I am very new to Android. I am trying to create a social application that contains a lot of images and some metadata. It has a screen similar to a Facebook feed. I want to make this screen as smooth and standard as possible.
Here are the libraries that I use: OkHttp, Picasso, Retrofit, Gson.
Now I am collecting all json at a time, since I ran dummy values in the backend, and the answer is quite small. But in the future, it will have previous and next fields to limit the json response.
Some of the questions I have right now are:
I am using Picasso with OkHttp. Are cache images on disk either or only in memory?
What are the best methods for caching a feed? Since most of the content is images, should I just let Picasso handle caching, or should I cache some elements myself? I heard about the DiskLruCache library from JakeWharton, but have not tried it. Should I go with him?
How to save the contents of the feed (for example, 3 or 4) in any direction of scrolling in the cache, so that the scrolling looks smooth and that the images do not load after appearing in the view.
How to automatically process the json response using the previous and next fields when the user scrolls through all the content that was selected this time. Basically I want to run queries based on the amount of content scrollable based on cursors.
Suppose there is a button and the user clicks it, should I change the number of likes in the user interface and side by sending a POST request to update the counter, or should I send a request and wait for the counter to be updated from the server before it is updated in the user interface?
I already went through the Instamaterial source code and found out some amazing things. But this does not demonstrate the integration of the entire base.
I just want to know if there are any other open source applications that I can study or study with. If you know any tutorials that will help too. I just want the app to look as smooth as possible, and you want to learn some best practices.
performance android caching retrofit picasso
Amit tiwari
source share