Good afternoon, the task itself is as follows: there is a database, there is a huge amount of data in it, of course when sending a request query server (php) it gives a huge amount of data and in the client (android) it should somehow be reflected, but firstly it is a huge load on the server, and secondly, the traffic load; therefore, issuing a complete database and displaying it in the client with a single request is a bad idea.

How do I see a solution to this problem? Paginate, display, for example, 10 elements on the client, scroll down, some other elements are downloaded, etc. But for this it is necessary that the server did not give out all the data at once, but in pieces, for example, 10 elements each.

How to implement it all? Which way to look?

  • towards database query on server - Vladyslav Matviienko
  • What database is used? - Chubatiy
  • the adapter is responsible for "resuming" the elements to be displayed, so there is not much to worry about, well, you will have to work with inquiries to the server and their management .. - ZigZag
  • @Chubatiy MySql - Martinez Toni

2 answers 2

You need:

  1. When requested from the application to the server to send him the page number.
  2. The script accepts this number and makes a request to the database considering this number and the number of elements per page.
  3. And it sends data to the application.
  • one
    Comments are not intended for extended discussion; conversation moved to chat . - Nick Volynkin

So you yourself told how to do it all! The first request we do is Select Top 10 ... Order by SortField when moving to the next batch, add Where SortField > &Last1SortField