Retrofit 2 — Pagination Using Range Header Fields (Like Heroku)

This is the third tutorial around pagination on Android. We’ve previously guided you through the details of partial responses with pagination using query parameter and response header including a dynamic url for further paginated requests. You see, as we’re showing you three implementations on pagination, this topic is quite important when working with APIs.

This third article around pagination will show you how to implement this functionality on client-side using HTTP range header fields to fetch partial data from a resource set. Usually, the range headers are already prepared by the server and you can adjust them on your client.

Before diving into the details of pagination using HTTP range headers, you should review the list of available posts within this Retrofit series.

Retrofit Series Overview

  1. Callbacks (Coming soon)
  2. Annotations (Coming soon)
  3. Fluent Interface with Builders (Coming soon)


Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $12/mo

Explore the Library

Find interesting tutorials and solutions for your problems.

Miscellaneous