Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: NetworkBoundRsource vs RemoteMediator

What are the differences between NetworkBoundResource and RemoteMediator (Paging 3)?

like image 803
Smirky Avatar asked Sep 16 '26 07:09

Smirky


1 Answers

NetworkBoundResource is just a sample helper class wrapping some data backed by both network + db, this has nothing to do with pagination.

RemoteMediator is a Paging3 class which gives you callbacks for when you run out of data to load while paginating using the Paging library. It is typically used to trigger remote loads to fetch additional data for paging in the db + network case.

like image 63
dlam Avatar answered Sep 18 '26 21:09

dlam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!