Slide 1

Slide 1 text

IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Building Offline First Apps for Exceptional User Experiences — Bradley Holt Developer Advocate Senior Software Engineer

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Offline Camp IBM Cloud / March 6, 2018 / © 2018 IBM Corporation We are building an Offline First community, one campfire at a time. Offline Camp has visited the Catskills of New York, the Central Coast of California, Berlin, and Oregon.

Slide 4

Slide 4 text

https://youtu.be/bWXAZboHZN8

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Not just offline… IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Accès wi-fi à Gorakshep (5140m) by Jerome Bon, on Flickr (CC BY 2.0).

Slide 7

Slide 7 text

Reliable, fast, and engaging user experience— regardless of network connectivity IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Static Wallpaper by James Spinks, on Flickr (CC BY-SA 2.0).

Slide 8

Slide 8 text

Zero-latency access to content & data IBM Cloud / March 6, 2018 / © 2018 IBM Corporation speed 3 by Monkieyes, on Flickr (CC BY 2.0).

Slide 9

Slide 9 text

IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Offline, Online & ¯\_(ツ)_/¯ underground by weckgeschnappt_, on Flickr (CC BY 2.0).

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Shopping List IBM Cloud / March 6, 2018 / © 2018 IBM Corporation A series of demo Progressive Web Apps, hybrid mobile apps, native mobile apps, and a desktop app— each built using a different stack https://ibm-watson-data-lab.github.io/shopping-list-demo

Slide 12

Slide 12 text

https://github.com/ibm-watson-data-lab/shopping-list

Slide 13

Slide 13 text

https://developer.ibm.com/code/patterns/create-an-offline-first-shopping-list-with-polymer-and-pouchdb/

Slide 14

Slide 14 text

Progressive Web Apps IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Provides both the discoverability of a web app and the reliable, fast, and engaging user experience of a native mobile app

Slide 15

Slide 15 text

https://www.pwastats.com/

Slide 16

Slide 16 text

https://developers.google.com/web/showcase/2017/twitter

Slide 17

Slide 17 text

The next billion people on the internet IBM Cloud / March 6, 2018 / © 2018 IBM Corporation the galaxy by tommy@chau, on Flickr (CC BY 2.0).

Slide 18

Slide 18 text

Geolocation API Network Information API IndexedDB WebRTC API Push API Notifications API Device Orientation API Screen Orientation API Permissions API Proximity API Pointer Lock API Vibration API Payment Request API Battery Status API Ambient Light Sensor API Service Worker API IBM Design Icons by International Business Machines Corporation (CC BY 4.0).

Slide 19

Slide 19 text

Service Workers IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Service Workers allow for fine- grained control over caching of content and assets, enabling cache-first web apps Service Workers fetch diagram by Mozilla Contributors (CC-BY-SA 2.5).

Slide 20

Slide 20 text

https://caniuse.com/#feat=serviceworkers

Slide 21

Slide 21 text

Registering a service worker example by Mozilla Contributors (CC-BY-SA 2.5).

Slide 22

Slide 22 text

Install and activate a service worker example by Mozilla Contributors (CC-BY-SA 2.5).

Slide 23

Slide 23 text

Custom service worker response example by Mozilla Contributors (CC-BY-SA 2.5).

Slide 24

Slide 24 text

IndexedDB IBM Cloud / March 6, 2018 / © 2018 IBM Corporation IndexedDB enables app data to be stored locally within a browser IBM Design Icons by International Business Machines Corporation (CC BY 4.0).

Slide 25

Slide 25 text

https://caniuse.com/#search=indexdb

Slide 26

Slide 26 text

localForage IBM Cloud / March 6, 2018 / © 2018 IBM Corporation localForage is a polyfill that wraps IndexedDB, WebSQL, or localStorage, providing a consistent API regardless of which storage mechanism is supported by the end user’s browser IBM Design Icons by International Business Machines Corporation (CC BY 4.0).

Slide 27

Slide 27 text

https://github.com/localForage/localForage

Slide 28

Slide 28 text

Sync is Hard Technological devices designed by D3Images / Freepik . IBM Cloud / March 6, 2018 / © 2018 IBM Corporation

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Apache CouchDB PouchDB IBM Cloudant

Slide 31

Slide 31 text

“CouchDB’s superpower is sync. Sometimes I even try to explain it to people by saying, ‘CouchDB isn’t a database; it’s a sync engine.’ It’s a way of efficiently transferring data from one place to another, while intelligently managing conflicts and revisions. It’s very similar to Git. When I make that analogy, the light bulb often goes off.” Nolan Lawson PouchDB & CouchDB: An interview with Nolan Lawson IBM Cloud / March 6, 2018 / © 2018 IBM Corporation https://blog.couchdb.org/2017/04/04/pouchdb-couchdb-an-interview-with-nolan-lawson/

Slide 32

Slide 32 text

Offline Sync for Progressive Web Apps Apache CouchDB PouchDB Devices by Darwin Laganzon, on Pixabay (CC0 Public Domain). | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain).

Slide 33

Slide 33 text

https://pouchdb.com/

Slide 34

Slide 34 text

Pokedex.org IBM Cloud / March 6, 2018 / © 2018 IBM Corporation An offline-capable Progressive Web App built with Service Worker and PouchDB https://www.pokedex.org/

Slide 35

Slide 35 text

Hybrid Mobile Apps IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Tools such as Cordova and Ionic can be used to build native mobile apps using web platform tooling (HTML, CSS, and JavaScript), enabling you to target multiple platforms with one codebase

Slide 36

Slide 36 text

Offline Sync for Hybrid Mobile Apps Apache CouchDB PouchDB (SQLite adapter) IBM Design Icons by International Business Machines Corporation (CC BY 4.0). | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain).

Slide 37

Slide 37 text

Offline Sync for Hybrid Mobile Apps Apache CouchDB IBM Design Icons by International Business Machines Corporation (CC BY 4.0). | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain). Cloudant Sync – Cordova Plugin

Slide 38

Slide 38 text

Native Mobile Apps IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Native mobile apps provide a user experience tailored to the end user’s platform of choice

Slide 39

Slide 39 text

Offline Sync for Native Mobile Apps Apache CouchDB IBM Design Icons by International Business Machines Corporation (CC BY 4.0). | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain). Cloudant Sync for iOS or Android

Slide 40

Slide 40 text

Desktop Apps IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Tools such as Electron can be used to build cross- platform desktop apps using web platform tooling (HTML, CSS, and JavaScript)

Slide 41

Slide 41 text

Offline Sync for Desktop Electron Apps Apache CouchDB Technological devices designed by D3Images / Freepik . | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain). PouchDB (LevelDB or SQLite adapter)

Slide 42

Slide 42 text

IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Multi-User Apps with Hoodie http://hood.ie/

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Apache CouchDB Devices by Darwin Laganzon, on Pixabay (CC0 Public Domain). | Cloud by Raphael Silva, on Pixabay (CC0 Public Domain).

Slide 45

Slide 45 text

Cloudant Envoy

Slide 46

Slide 46 text

Join the Offline First community IBM Cloud / March 6, 2018 / © 2018 IBM Corporation

Slide 47

Slide 47 text

IBM Cloud / March 6, 2018 / © 2018 IBM Corporation offlinefirst.org/chat

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

https://medium.com/offline-camp

Slide 50

Slide 50 text

Thank you IBM Cloud / March 6, 2018 / © 2018 IBM Corporation Bradley Holt Developer Advocate Senior Software Engineer — ibm.com

Slide 51

Slide 51 text

IBM Cloud / March 6, 2018 / © 2018 IBM Corporation