Real-time and APIs

5 concepts · 15 practice questions

Paging

Paging 3 loads a long list in pages as the user scrolls. A PagingSource loads one page for a key; cachedIn keeps loaded pages in memory across configuration changes; a RemoteMediator fills a Room table from the network so the list pages from the database and works offline.

val articles: Flow<PagingData<Article>> = Pager(PagingConfig(pageSize = 30)) {
    articleDao.pagingSource()
}.flow.cachedIn(viewModelScope)

Also covered

WebSockets and real-time updates
GraphQL
JSON serialization
Resilient networking

Sign in to read the rest and take the 15-question test.

Sign in to continue