Book Image

Offline First Web Development

By : Daniel Sauble
Book Image

Offline First Web Development

By: Daniel Sauble

Overview of this book

When building mobile apps, it’s easy to forget about the moments when your users lack a good Internet connection. Put your phone in airplane mode, open a few popular apps, and you’ll quickly see how they handle being offline. From Twitter to Pinterest to Apple Maps, some apps might handle being offline better—but very few do it well. A poor offline experience will result in frustrated users who will abandon your app, or worse, turn to your competitor’s apps Expert or novice, this book will teach you everything you need to know about designing and building a rigorous offline app experience. By putting the offline experience first, you’ll have a solid foundation to build upon, avoiding the unnecessary stress and frustration of trying to retrofit offline capabilities into your finished app. This basic principle, designing for the worst-case scenario, could save you countless hours of wasted effort.
Table of Contents (17 chapters)
Offline First Web Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The offline paradigm


Internet connectivity is only one part of the puzzle. Modern devices rely on different types of wireless networks: GPS, LTE, 4G, 3G, Edge, GPRS, Wi-Fi, Bluetooth, and RFID, among others. If any of these go down, she mused, certain bad things can happen:

  • If GPS goes down, it can mess up your fitness tracking resulting in erratic maps and false progress toward your fitness goals.

  • As your mobile connection degrades from 4G to GPRS, web browsing slows and eventually stops. Wi-Fi has the same problem.

  • Bluetooth is also important. It connects us to our keyboards, mouses, headsets, and other devices. As the signal weakens, these accessories become unreliable or cease functioning altogether.

  • NFC, while not ubiquitous today, certainly will be so in the future. We'll depend on it for all or most of our Point of Sale (POS) financial transactions. If it goes down, can we use other networks as backup?

Susan stopped writing and put down her pen. She gazed reflectively at the list. The paper lay on top of her laptop as though mocking the brick that lay underneath.

So, with these failure cases, how might we develop our apps differently? More importantly, is there a common set of principles that we can use in order to avoid reinventing the wheel each time? What makes an excellent offline experience?

Hand reached for pen and she began a second list:

Principles for a great offline experience are as follows:

  • Give me uninterrupted access to the content I care about.

  • Content is mutable. Don't let my online/offline status change that.

  • Error messages should not leave me guessing or unnecessarily worried.

  • Don't let me start something I can't finish.

  • An app should never contradict itself. If a conflict exists, be honest about it.

  • When the laws of physics prevail, choose breadth over depth when caching.

  • Empty states should tell me what to do next in a delightful way.

  • Don't make me remember what I was doing last. Remember for me.

  • Degrade gracefully as the network degrades. Don't be jarring.

  • Never purge the cache unless I demand it.

Susan put her pen down. A good list. She gave a contented nod, put the paper in her bag, and walked out of the café, humming to herself. It was an interesting thought exercise and possibly more. She would bring it up with her design team at their 10 o'clock review. Their project might benefit from these principles.