I build an android app in which i have a large customer list.It receive data from server in JSON from and I show this JSON in Custom List view. But it take lot of time when Internet show cause of large list of customer. I want to use Auto Update List when i scroll list it receive next JSON list from server and show it in list view like android mail app. i am totally new in this so i want help in section from beginning.
Asked
Active
Viewed 129 times
0
-
1Can we see your code so far? – Raghu Teja Oct 23 '15 at 11:43
-
I am not getting.. you want pull to refresh facility? please refer http://www.androidhive.info/2015/05/android-swipe-down-to-refresh-listview-tutorial/ – Oct 23 '15 at 11:50
-
you can just add a listview listener that detects the end of the list. If end is reached, then new (i.e. the next 20 listdata) data should be add to the list and save the count in sharedpreferences. Of course you need to adjust the server side accordingly. http://stackoverflow.com/questions/5065339/android-dynamically-load-listview-at-scroll-end – Sini Oct 23 '15 at 12:01
1 Answers
0
You will need to implement pagination on server side. In your original request the server will send you a list of customers (say 20), and total no. of pages (considering each page has 20 customers) or total no. of customers. Based on this data, you can request for the next list of customers once your scroll hits the end, send another request with the page_no or whatever logic you implement to request the next list. Add the next list of customers into your adapter's data.
You can find many code snippets on how to figure out if your scroll has reached the end of list. Here is a guide on how to implement EndLess scroll in your listview.

Akhunzaada
- 64
- 3