0

I want to load data like paytm and flipkart load data. When you scroll it, it will show and load. Even also save data until network available. Please help me how can I manage it. I have different layouts and more than 30 apis. I am pure native android developer. Can anyone help me?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • For implementing scroll and load you manage that programmatically to check end of view and then request more data from your server and continue loading. To have offline capabilities store data in some db and have a **background service** running to check network availability. If internet available update the data else show the stored data. – skWyz Nov 09 '19 at 11:56
  • ou are telling about WorkManager. But I want to store it without db. And also scroll like paytm app or flipkart app. Load only selected data and then when you scroll more it will show you other data. – Parik Dhakan Nov 11 '19 at 03:55
  • if you don't want to use db then you each time you need data get data from your server. you can use [link](https://stackoverflow.com/a/4953744/9235879) to get end of view and can request data from server and display live. – skWyz Nov 12 '19 at 05:57

1 Answers1

0

for saving data to load without internet follow this tutorial Room database and Repository in MVVM this video is a part of a series

No need to follow MVVM Architecture strictly,

for loading data you need to implement paging in your app follow this tutorial Paging Library implementation

Rahul Gaur
  • 1,661
  • 1
  • 13
  • 29
  • The Paging Library makes it easier for you to load data gradually and gracefully within your app's RecyclerView. But I have more than 30 APIs and all are differently. Not only recyclerview. – Parik Dhakan Nov 11 '19 at 03:52
  • If you are calling most APIs at once async then the main problem is different. You can create a Repository for the data, which will save the data for future uses this will prevent extra API calls, and save time and processing power – Rahul Gaur Nov 11 '19 at 04:08
  • But how can I load data like paytm load it. Also they have different view. So,how can I do it? – Parik Dhakan Nov 11 '19 at 04:26