2. What we discuss here..
Why we should care about offline mode?
3 Steps implementing offline mode
Data conflict (detection and solution)
3. Why we should care about offline mode?
The most used smartophone apps are trying more and more to provide
content while offline. People still can do their activity even when the
network is off. For example, apps like Evernote even let users create
and edit notes while offline.
Sometimes there is no mobile network at all, e.g. in the subway. In the
train the network can go up and down. Sometimes it's slow, sometimes
it's fast. The biggest cities in the world have 4G now, but even in these
big cities there are still a lot of areas where the moblie network is slow.
Moblie networks are different: latency is high, speed is very
inconsistent, which is the worst in terms of user experince (Ilya
Grigorik from Google: "Faster Websites: Crash Course on Frontend
Performance (Part 1/2)", Devoxx 2012)
4.
5. 3 Steps implementing offline mode
Function to check internet connectivity (Android
Flow)
Storing data Locally (Mobile application Flow)
Store data from server into local storage when it’s available
(sync)
Leveraging http caching mechanisms (Rest API)
Cache-control
Etag and If-None-Match
Last-Modified and If-Modified-Since
9. Data conflict (Solutions)
How to solve conflict
show to the user both data (the current version on the device,
and the current version on the server) and let him keep what
he wants.
Or, letting the latest version in time win.