Cash App

Cash App Announces Multiplatform Paging

Original post Announcing Multiplatform Paging

Article Summary

Veyndan Stuart from Cash App just open-sourced a solution to one of mobile development's most annoying problems: writing pagination logic twice for Android and iOS.

Cash App released Multiplatform Paging, a Kotlin Multiplatform wrapper around AndroidX Paging that lets teams share pagination logic across platforms. It tackles the hard problems of paginated data (caching, request deduplication, page jumping) without rewriting code for each platform.

Key Takeaways

Critical Insight

Cash App's Multiplatform Paging lets you write pagination logic once and use it on both Android and iOS without learning a new API.

Continue reading

What This Article Covers

Problem

Pagination looks straightforward on the surface, but it involves tricky problems like in-memory caching, request deduplication, and page jumping that need complex solutions across multiple platforms.

Solution

Cash App wrapped AndroidX Paging for Kotlin and Multiplatform by creating two modules: paging-common for shared logic across platforms and paging-runtime for Android and iOS.

Impact

Multiplatform Paging maintains binary compatibility with AndroidX Paging on the JVM, so all dependent libraries keep working without any modifications or API changes.

The library's approach to maintaining binary compatibility while going multiplatform is particularly clever.

This page summarizes “Announcing Multiplatform Paging” by Cash App, published Nov 10, 2022. All credit for the original work goes to the authors.

Read the original on code.cash.app (opens in new tab)

AI tools for Android

Browse all AI tools →