How does the facebook or instagram app save images or data after logging in to the app without an internet connection?

In the Facebook application, for example, I can log in with my Internet connection. Then I close the application, turn off the Internet and close all of my system tabs. Then even if my Internet connection is disconnected, I can see that the images and data that were previously downloaded are still saved.

How does the Facebook app do this? What if you want to implement such a function in your Android application?

+3
source share
4 answers

I use the Picasso library to cache, download ... images from the Internet:

http://square.imtqy.com/picasso/

Picasso.with(context)
   .load(url)
   .resize(50, 50)
   .centerCrop()
   .into(imageView)

shared preferences , sqlite

+3

( ) - . - (, okhttp)

+1

, Facebook Android , , DiskLruCache. Facebook . , Sqlite Realm .

0

All Articles