Using HTML5 Offline Storage. Brady Eidson Safari and WebKit Engineer

Similar documents
Creating Extensions for Safari

Tizen Ver2.2 - HTML5 Web Storage

Beyond Cookies: Persistent Storage for Web Applications. Brad Neuberg Google

Support Offline Mobile Web Apps with HTML5 API's

Current Trends in Native and Cross-Platform Mobile Application Development

Using GWT and Eclipse to Build Great Mobile Web Apps

Introducing the Modern WebKit API

Creating Content with iad JS

Copyright is owned by the Author of the thesis. Permission is given for a copy to be downloaded by an individual for the purpose of research and

Sam Weinig Safari and WebKit Engineer. Chris Marrin Safari and WebKit Engineer

Review of Mobile Web Application Frameworks

HTML5 and CSS3: New Markup & Styles for the Emerging Web. Jason Clark Head of Digital Access & Web Services Montana State University Library

What s New in CloudKit

HTML5 and Mobile: New Markup & Styles for the Mobile Web. Jason Clark Head of Digital Access & Web Services Montana State University Libraries

What s New in XAML Q Release

Build Native-like Experiences in HTML5

Kevin van Vechten Core OS

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Advanced JavaScript. Gary Sheppard & James Tedrick

Managing State. Chapter 13

Offline-first PWA con Firebase y Vue.js

QCon - Mobile Maps HTML5 Team Andrea

Persistence. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Programming in HTML5 with JavaScript and CSS3

Cache Pattern for Offline Web Applications

Persistence & State. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jquery. Andy Gup, Lloyd Heberlie

Introducing CloudKit. A how-to guide for icloud for your Apps. Frameworks #WWDC14. Session 208 Olivier Bonnet CloudKit Client Software

WebKit ; FOR : DUMMIES. by Chris Minnick WILEY. John Wiley & Sons, Inc.

Accessing Positive Networks on an ipad/iphone

Rapid Application Development for the Cloud

Introducing Password AutoFill for Apps

Human-Computer Interaction Design

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

10/18/2017. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414

Monetize and Promote Your App with iad

Introducing On Demand Resources

dox42 Azure Active Directory Integration

Enhance Your WinForms LOB Applications with PDF Viewer, PivotGrid, and Reporting

Building Offline Mobile Apps with Oracle JET and MCS

Introducing the Photos Frameworks

Game Center Techniques, Part 1

Building mobile app using Cordova and AngularJS, common practices. Goran Kopevski

Deploying to the Edge CouchDB

APEX Unplugged Building Oracle Application Express Applications That Can Survive Without the Internet. Dan McGhan Senior Technical Consultant


Working with Metal Overview

Creating a Client-Side Search Engine with Gears. Brad Neuberg, Gears

ArcGIS Enterprise Security: Advanced. Gregory Ponto & Jeff Smith

Index LICENSED PRODUCT NOT FOR RESALE

Querying Data with Transact SQL

The Gearman Cookbook OSCON Eric Day Senior Software Rackspace

NoSQL & Firebase. SWE 432, Fall Web Application Development

What s New in Energy Debugging

MySQL & NoSQL: The Best of Both Worlds

High Performance HTML5

Offline First. HTML5 technologies for a faster, smarter, more engaging web. draft John Allsopp, Web Directions

Introduction. Server-side Techniques. Introduction. 2 modes in the PHP processor:

Course 20480: Programming in HTML5 with JavaScript and CSS3

Seamless Linking to Your App

Service Workers & APEX

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Building Mobile Apps with HTML5

Hands-On with IoT Standards & Protocols

Eme03. Mobilise your Applications as Progressive Web Apps

Performance Testing and Comparison of Client Side Databases Versus Server Side

HTML5 MOCK TEST HTML5 MOCK TEST I

Mastering Xcode for iphone OS Development Part 2. Marc Verstaen Sr. Manager, iphone Tools

Building Mobile Apps with the ArcGIS API for JavaScript. Andy Gup, Lloyd Heberlie, Thomas Other

Programming in HTML5 with JavaScript and CSS3

NoSQL Databases An efficient way to store and query heterogeneous astronomical data in DACE. Nicolas Buchschacher - University of Geneva - ADASS 2018

RESTful APIs ECS 189 WEB PROGRAMMING. Browser s view. Browser s view. Browser s view. Browser s view. Which will It be for photobooth?

Creating a Client-Side Search Engine with Gears and Dojo. Brad Neuberg, Google

the web as it should be Martin Beeby

Cross Platform Nearby Networking

AWS Lambda + nodejs Hands-On Training

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Connect Your Clouds with Force.com

Programming in HTML5 with JavaScript and CSS3

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer

Set up your computer to sync your OneDrive for Business files in Office 365

Assignment 1 Mobile client application

Project Horizon Technical Overview. Bob Rullo GM; Presentation Architecture

HTML5 in Action ROB CROWTHER JOE LENNON ASH BLUE GREG WANISH MANNING SHELTER ISLAND

Jim Jackson II Ian Gilman

What's New in Foundation Networking

}w!"#$%&'()+,-./012345<ya

HTML5 Web Security. Thomas Röthlisberger IT Security Analyst

System Design and Tuning

CS142 - Web Applications

20480B - Version: 1. Programming in HTML5 with JavaScript and CSS3

Using and Extending the Xcode Source Editor

Content Protection for HTTP Live Streaming

Learn Well Technocraft

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow

ArcGIS GeoEvent Server: Making 3D Scenes Come Alive with Real-Time Data

Session id: The Self-Managing Database: Guided Application and SQL Tuning

Introduction to Web Concepts & Technologies

ArcGIS Runtime SDK for Java: A Beginner s Guide. Mark Baird JC Malott

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

Transcription:

Using HTML5 Offline Storage Brady Eidson Safari and WebKit Engineer 2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

So what can I do without the cloud? 22

What You ll Learn Make apps accessible offline Persist simple data Data center in the browser 23

What You ll Learn Make apps accessible offline Persist simple data Data center in the browser 24

HTML5 Application Cache 25

HTML5 Application Cache Overview Store entire application offline Automated atomic updates You specify a resource manifest A little nonmandatory API 26

HTML5 Application Cache Advantages Your app works offline Your app works online but faster! 27

HTML5 Application Cache How applications are loaded 1. With a manifest, local copies of each resource are used 28

HTML5 Application Cache How applications are loaded 2. Safari revalidates the manifest file in the background? 29

HTML5 Application Cache How applications are loaded 2. Safari revalidates the manifest file in the background 30

HTML5 Application Cache How applications are loaded 3. If the manifest changed, each individual resource is revalidated 31

HTML5 Application Cache How applications are loaded 4. The new version of your application is ready to go 32

Application Cache Demo 33

HTML5 Application Cache T-Spin demo Server must know the text/cache-manifest mime type Specify manifest in HTML Resources not in the manifest fail to load Server-side changes to manifest trigger an update Update process is automatic 34

Now that my app works offline how about all the data it creates? 35

What You ll Learn Make apps accessible offline Persist simple data Data center in the browser 36

HTML5 Web Storage 37

HTML5 Web Storage Overview Standard interface for storing items of data Items are key/value pairs Origin-based security Various implementations of the interface 38

HTML5 Web Storage What implementations? SessionStorage for per-window data LocalStorage for global, persistent data Settings and SecureSettings in Safari extensions 39

HTML5 Web Storage How do I use it? function savesessionandquit() 40

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; } 41

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; } localstorage[ SavingSession ] = true; 42

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; localstorage[ SavingSession ] = true; } for (n in window.sessionstorage) { } 43

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; localstorage[ SavingSession ] = true; } for (n in window.sessionstorage) { localstorage.setitem(n, sessionstorage[n]); } 44

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; localstorage[ SavingSession ] = true; for (n in window.sessionstorage) { localstorage.setitem(n, sessionstorage[n]); } } localstorage.removeitem( SavingSession ); 45

HTML5 Web Storage How do I use it? function savesessionandquit() { window.localstorage.windowlocation = 32,117 ; localstorage[ SavingSession ] = true; for (n in window.sessionstorage) { localstorage.setitem(n, sessionstorage[n]); } localstorage.removeitem( SavingSession ); } sessionstorage.clear(); 46

Web Storage Demo Featuring Andy Estes Safari and WebKit Engineer 47

HTML5 Web Storage T-Spin demo Use window.localstorage for global, persistent data Different ways to store and retrieve the same items 48

Now that I can store the simple stuff how about a little more oomph? 49

What You ll Learn Make apps accessible offline Persist simple data Data center in the browser 50

HTML5 SQL Databases 51

HTML5 SQL Databases Overview Real-world SQL Asynchronous and callback-based Origin-based security 52

HTML5 SQL Databases Advantages of keeping it local Works offline Better performance Faster fetching Lower latency Better battery life 53

HTML5 SQL Databases Overview Real-world SQL Asynchronous and callback-based Origin-based security 54

Real-world SQL 55

Tables 56

Rows of Data 57

Indexes 58

Triggers 59

Transactions are built in to the API 60

HTML5 SQL Databases Executing a query 1. Get a database object to work with Window 61

HTML5 SQL Databases Executing a query 1. Get a database object to work with Window.openDatabase( MyDatabase, null, null, null) 62

HTML5 SQL Databases Executing a query 1. Get a database object to work with Window.openDatabase( MyDatabase, null, null, null) Database 63

HTML5 SQL Databases Executing a query 1. Get a database object to work with Window.openDatabase( MyDatabase, null, null, null) Database 64

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction Database 65

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction Database.transaction(callbackFunction) 66

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction Database.transaction(callbackFunction) function TransactionCallback(SQLTransaction tx) {... } 67

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction Database.transaction(callbackFunction) function TransactionCallback(SQLTransaction tx) {... } 68

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction function TransactionCallback(SQLTransaction tx) {... } SQLTransaction 69

HTML5 SQL Databases Executing a query 2. Start a SQLTransaction function TransactionCallback(SQLTransaction tx) {... } SQLTransaction 70

HTML5 SQL Databases Executing a query 3. Execute some SQL! SQLTransaction 71

HTML5 SQL Databases Executing a query 3. Execute some SQL! SQLTransaction.executeSql( CREATE TABLE testtable (id testvalue) ) 72

SQL Database Demo 73

HTML5 SQL Databases Demo SQL queries available directly from JavaScript Handle complex, relational data in the browser Performance superior to the cloud 74

75

76

77

More Information Vicki Murley Safari Technologies Evangelist vicki@apple.com HTML5 Application Cache Specification http://www.whatwg.org/specs/web-apps/current-work HTML5 Web Storage Specification http://dev.w3.org/html5/webstorage HTML5 Web SQL Database Specification http://dev.w3.org/html5/webdatabase WebKit Open Source Project http://www.webkit.org/ #webkit on irc.freenode.net Apple Developer Forums http://devforums.apple.com 78

Labs Safari Extensions Lab HTML5 Offline Storage Lab Safari Open Lab Internet and Web Lab A Thursday 2:00PM Internet and Web Lab B Thursday 4:30PM Internet and Web Lab A Friday 9:00AM 79

Q&A 80

81

82