SlideShare a Scribd company logo
1 of 24
The best UI platform yet…
The WWW platform
 W3C has been adding features to HTML
 Major browsers support the standards


   Latest version is HTML5
     Has all of the power of native applications
     Plus more!
Outline
   Introduction
   HTML5 for HCI
   Why choose HTML5?
   <canvas>
   WebGL
   Multi-touch
   Web SQL Database
   Web Sockets
   Better local file support
   Offline support
   Conclusion
Introduction
 Important to stay current in HCI
 Browsers will eventually replace other UI
  platforms
HTML5 for HCI
   <audio> and <video> tags

   <canvas> element

   SVG

   WebGL

   Touch API

Flash has been replaced
Why HTML5?
   HTML5 and javascript are interpreted
     No compilation
     Can test UI changes with a console window




               Firebug extension for Firefox
Why HTML5?
   Cross-platform
     Most browsers (read: not IE) conform to the
      W3C standards
     The same code works on PC, Mac, Linux
Why HTML5?
   Mobile device support
Why HTML5?
   No need for software updates
     Everyone sees the latest version


   Development can be done anywhere
     No need for special software
     Just a terminal and Firefox/Firebug
<canvas>
 Acts like a canvas
 Can draw on it using vector functions
     Lines
     Rectangles
     Paths
      ○ Arcs
      ○ Curves
<canvas>
   Or using raster functions
     Copy from HTML element
      ○ <img>
      ○ <video>
     Manipulate pixels directly
     Image processing
<canvas> example
<html>
          <head>
                   <script>
                   function a() {
                     var c = document.getElementById(„c‟);
                     var ctxt = c.getContext(„2d‟);
                     ctxt.arc(50, 50, // Center of circle (x, y)
                                    25, // Radius
                                    Math.PI / 2, // Start angle
                                    0, // End angle
                                    false // Counter-clockwise
                     );
                     ctxt.stroke();
                   }
                   </script>
          </head>
          <body onload=“a();”>
                  <canvas id=“c” height=“100” width=“200”></canvas>
          </body>
</html>
<canvas> example
WebGL
 Native 3D rendering in the browser
 Makes use of the same <canvas>
  element
 Syntax is like OpenGL


Lessons
Quake II
Multi-touch
   Gave this in last
    presentation, but here‟s
    a link to the tutorial

http://developer.apple.com/safari/library/documentation/appleapplications/reference/saf
ariwebcontent/handlingevents/handlingevents.html


   Works with iPad/iPhone/iPod and Windows
    7 with Chrome & Firefox
Web SQL Database
   Can store relational
    data locally in the
    browser
   Especially useful for
    offline apps (more
    later)
Web SQL Database
db = openDatabase(
      „testDB‟, // Name
      „1.0‟, // Version
      „Testing database‟, // User-friendly name
      1000000 // Maximum size (bytes)
);
db.transaction(function(tx) {
      tx.executeSql(„CREATE TABLE Foo (ID INT,
Name TEXT)‟);
      tx.executeSql(„INSERT INTO Foo (ID, Name)
Values(1, „bar‟);
});
Web SQL Database

db.transaction(function(tx) {
        tx.executeSql('SELECT * FROM Foo', [], function (tx, results) {
                var len = results.rows.length, i;
                for (i = 0; i < len; i++) {
                          var row = results.rows[i];
                          alert(row.ID + „ – „ + row.Name);
                }
        });
});
Web Sockets
   HTML now allows persistent
    connections with the server
   Real-time collaboration and
    updates
   Examples:
     Stock ticker
     Chat room
     White board


http://www.indicthreads.com/1525/building-real-
time-web-applications-using-html-5-web-sockets/
Working with Files
   Using Files in Web Applications
Offline support
HTML File

<html manifest=“offline.manifest”>…

Offline.manifest contents (must have MIME type of
text/cache-manifest)

CACHE MANIFEST
styles.css
jquery-1.4.min.js
offline.js
index.html
Detect online/offline events
// standard event listeners
window.addEventListener("online", function() { ... });
window.addEventListener("offline", function() { ... });
Recommendations
 Use Firefox with Firebug
 jQuery is a fantastic library!
 HTML5 can be used for iOS apps too!
     Ask for my last presentation slides
Conclusions
 Let the web browser developers do all
  the hard work
 Applications have never been more
  easy with HTML5
 Great features at a great price
 Develop without the need for bulky IDEs

More Related Content

What's hot

OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and MobileOpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and MobileDierk König
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 
Real Time Event Dispatcher
Real Time Event DispatcherReal Time Event Dispatcher
Real Time Event DispatcherPeter Dietrich
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
The evolution of java script asynchronous calls
The evolution of java script asynchronous callsThe evolution of java script asynchronous calls
The evolution of java script asynchronous callsHuy Hoàng Phạm
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.jsJosh Staples
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRJavier Abadía
 
JavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncJavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncFalko Riemenschneider
 
Django + Vue, JavaScript de 3ª generación para modernizar Django
Django + Vue, JavaScript de 3ª generación para modernizar DjangoDjango + Vue, JavaScript de 3ª generación para modernizar Django
Django + Vue, JavaScript de 3ª generación para modernizar DjangoJavier Abadía
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
Backbone.js and friends
Backbone.js and friendsBackbone.js and friends
Backbone.js and friendsGood Robot
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentationScott Messinger
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
Unity and WebSockets
Unity and WebSocketsUnity and WebSockets
Unity and WebSocketsJosh Glover
 
Workshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewWorkshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewVisual Engineering
 

What's hot (19)

Grails and Ajax
Grails and AjaxGrails and Ajax
Grails and Ajax
 
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and MobileOpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 
Workers
WorkersWorkers
Workers
 
Real Time Event Dispatcher
Real Time Event DispatcherReal Time Event Dispatcher
Real Time Event Dispatcher
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
The evolution of java script asynchronous calls
The evolution of java script asynchronous callsThe evolution of java script asynchronous calls
The evolution of java script asynchronous calls
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMR
 
JavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncJavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.async
 
Django + Vue, JavaScript de 3ª generación para modernizar Django
Django + Vue, JavaScript de 3ª generación para modernizar DjangoDjango + Vue, JavaScript de 3ª generación para modernizar Django
Django + Vue, JavaScript de 3ª generación para modernizar Django
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
 
Backbone.js and friends
Backbone.js and friendsBackbone.js and friends
Backbone.js and friends
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentation
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
Human Talks - StencilJS
Human Talks - StencilJSHuman Talks - StencilJS
Human Talks - StencilJS
 
Unity and WebSockets
Unity and WebSocketsUnity and WebSockets
Unity and WebSockets
 
Workshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewWorkshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General Overview
 

Viewers also liked

Mobile Development: Social Media Experience
Mobile Development: Social Media ExperienceMobile Development: Social Media Experience
Mobile Development: Social Media ExperienceReena Prema
 
Seo cheat sheet_2-2013
Seo cheat sheet_2-2013Seo cheat sheet_2-2013
Seo cheat sheet_2-2013ekkarthik
 
4CNW discovery session for Business in North West Ireland
4CNW discovery session for Business in North West Ireland4CNW discovery session for Business in North West Ireland
4CNW discovery session for Business in North West IrelandThe Creative State North West
 
How to use Autoboss V30 Tool ?
How to use Autoboss V30 Tool ? How to use Autoboss V30 Tool ?
How to use Autoboss V30 Tool ? Amy joe
 
Hybrid Solution to Portfolio Management
Hybrid Solution to Portfolio ManagementHybrid Solution to Portfolio Management
Hybrid Solution to Portfolio ManagementBen Esget
 
Подъёмные телескопические стойки Fenix. Каталог.
Подъёмные телескопические стойки Fenix. Каталог.Подъёмные телескопические стойки Fenix. Каталог.
Подъёмные телескопические стойки Fenix. Каталог.deniskazakov3979
 
Daughters Without Dads Inc
Daughters Without Dads IncDaughters Without Dads Inc
Daughters Without Dads Incarmstrongdoresa
 
Mc cormick mobilelearningcrashcourse_15.10.12
Mc cormick mobilelearningcrashcourse_15.10.12Mc cormick mobilelearningcrashcourse_15.10.12
Mc cormick mobilelearningcrashcourse_15.10.12Scott McCormick
 
How to Create an Effective PowerPoint
How to Create an Effective PowerPointHow to Create an Effective PowerPoint
How to Create an Effective PowerPointu1024811
 
THE LAST 15 YEARS ON WALL STREET PART II
THE LAST 15 YEARS ON WALL STREET PART IITHE LAST 15 YEARS ON WALL STREET PART II
THE LAST 15 YEARS ON WALL STREET PART IIBen Esget
 
03 17-15 panacea 15 03
03 17-15 panacea 15 0303 17-15 panacea 15 03
03 17-15 panacea 15 03Brian Sear
 
Successful Investing in a Low Growth Economy: A Historical Perspective
Successful Investing in a Low Growth Economy: A Historical PerspectiveSuccessful Investing in a Low Growth Economy: A Historical Perspective
Successful Investing in a Low Growth Economy: A Historical PerspectiveBen Esget
 
Applying to b school in a few years - a few tips
Applying to b school in a few years - a few tipsApplying to b school in a few years - a few tips
Applying to b school in a few years - a few tipsAmerasia Consulting Group
 
Business Growth
Business GrowthBusiness Growth
Business GrowthShadiAR
 
Guia cuatro luz
Guia cuatro luzGuia cuatro luz
Guia cuatro luzLuzParraP
 
Shaping the role_of_hr_127
Shaping the role_of_hr_127Shaping the role_of_hr_127
Shaping the role_of_hr_127Naresh Trainer
 
Tips for maximizing your business school visits
Tips for maximizing your business school visitsTips for maximizing your business school visits
Tips for maximizing your business school visitsAmerasia Consulting Group
 

Viewers also liked (20)

Mobile Development: Social Media Experience
Mobile Development: Social Media ExperienceMobile Development: Social Media Experience
Mobile Development: Social Media Experience
 
Seo cheat sheet_2-2013
Seo cheat sheet_2-2013Seo cheat sheet_2-2013
Seo cheat sheet_2-2013
 
4CNW discovery session for Business in North West Ireland
4CNW discovery session for Business in North West Ireland4CNW discovery session for Business in North West Ireland
4CNW discovery session for Business in North West Ireland
 
How to use Autoboss V30 Tool ?
How to use Autoboss V30 Tool ? How to use Autoboss V30 Tool ?
How to use Autoboss V30 Tool ?
 
Hybrid Solution to Portfolio Management
Hybrid Solution to Portfolio ManagementHybrid Solution to Portfolio Management
Hybrid Solution to Portfolio Management
 
Подъёмные телескопические стойки Fenix. Каталог.
Подъёмные телескопические стойки Fenix. Каталог.Подъёмные телескопические стойки Fenix. Каталог.
Подъёмные телескопические стойки Fenix. Каталог.
 
Daughters Without Dads Inc
Daughters Without Dads IncDaughters Without Dads Inc
Daughters Without Dads Inc
 
Mc cormick mobilelearningcrashcourse_15.10.12
Mc cormick mobilelearningcrashcourse_15.10.12Mc cormick mobilelearningcrashcourse_15.10.12
Mc cormick mobilelearningcrashcourse_15.10.12
 
How to Create an Effective PowerPoint
How to Create an Effective PowerPointHow to Create an Effective PowerPoint
How to Create an Effective PowerPoint
 
THE LAST 15 YEARS ON WALL STREET PART II
THE LAST 15 YEARS ON WALL STREET PART IITHE LAST 15 YEARS ON WALL STREET PART II
THE LAST 15 YEARS ON WALL STREET PART II
 
FFFF
FFFFFFFF
FFFF
 
03 17-15 panacea 15 03
03 17-15 panacea 15 0303 17-15 panacea 15 03
03 17-15 panacea 15 03
 
Successful Investing in a Low Growth Economy: A Historical Perspective
Successful Investing in a Low Growth Economy: A Historical PerspectiveSuccessful Investing in a Low Growth Economy: A Historical Perspective
Successful Investing in a Low Growth Economy: A Historical Perspective
 
Applying to b school in a few years - a few tips
Applying to b school in a few years - a few tipsApplying to b school in a few years - a few tips
Applying to b school in a few years - a few tips
 
Business Growth
Business GrowthBusiness Growth
Business Growth
 
Hrm10ech01
Hrm10ech01Hrm10ech01
Hrm10ech01
 
Guia cuatro luz
Guia cuatro luzGuia cuatro luz
Guia cuatro luz
 
Shaping the role_of_hr_127
Shaping the role_of_hr_127Shaping the role_of_hr_127
Shaping the role_of_hr_127
 
Tips for maximizing your business school visits
Tips for maximizing your business school visitsTips for maximizing your business school visits
Tips for maximizing your business school visits
 
Posonous plants
Posonous plantsPosonous plants
Posonous plants
 

Similar to The Best UI Platform Yet: An Introduction to HTML5 Features for HCI

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with VoltaDaniel Fisher
 
Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010Patrick Lauke
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008Caleb Jenkins
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersSascha Corti
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5Chris Mills
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5smueller_sandsmedia
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfPrabindh Sundareson
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyUlrich Krause
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkecker
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)Christian Rokitta
 

Similar to The Best UI Platform Yet: An Introduction to HTML5 Features for HCI (20)

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Html5
Html5Html5
Html5
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
GWT = easy AJAX
GWT = easy AJAXGWT = easy AJAX
GWT = easy AJAX
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
Html5
Html5Html5
Html5
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
Jsf2 html5-jazoon
Jsf2 html5-jazoonJsf2 html5-jazoon
Jsf2 html5-jazoon
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)
 

The Best UI Platform Yet: An Introduction to HTML5 Features for HCI

  • 1. The best UI platform yet…
  • 2. The WWW platform  W3C has been adding features to HTML  Major browsers support the standards  Latest version is HTML5  Has all of the power of native applications  Plus more!
  • 3. Outline  Introduction  HTML5 for HCI  Why choose HTML5?  <canvas>  WebGL  Multi-touch  Web SQL Database  Web Sockets  Better local file support  Offline support  Conclusion
  • 4. Introduction  Important to stay current in HCI  Browsers will eventually replace other UI platforms
  • 5. HTML5 for HCI  <audio> and <video> tags  <canvas> element  SVG  WebGL  Touch API Flash has been replaced
  • 6. Why HTML5?  HTML5 and javascript are interpreted  No compilation  Can test UI changes with a console window Firebug extension for Firefox
  • 7. Why HTML5?  Cross-platform  Most browsers (read: not IE) conform to the W3C standards  The same code works on PC, Mac, Linux
  • 8. Why HTML5?  Mobile device support
  • 9. Why HTML5?  No need for software updates  Everyone sees the latest version  Development can be done anywhere  No need for special software  Just a terminal and Firefox/Firebug
  • 10. <canvas>  Acts like a canvas  Can draw on it using vector functions  Lines  Rectangles  Paths ○ Arcs ○ Curves
  • 11. <canvas>  Or using raster functions  Copy from HTML element ○ <img> ○ <video>  Manipulate pixels directly  Image processing
  • 12. <canvas> example <html> <head> <script> function a() { var c = document.getElementById(„c‟); var ctxt = c.getContext(„2d‟); ctxt.arc(50, 50, // Center of circle (x, y) 25, // Radius Math.PI / 2, // Start angle 0, // End angle false // Counter-clockwise ); ctxt.stroke(); } </script> </head> <body onload=“a();”> <canvas id=“c” height=“100” width=“200”></canvas> </body> </html>
  • 14. WebGL  Native 3D rendering in the browser  Makes use of the same <canvas> element  Syntax is like OpenGL Lessons Quake II
  • 15. Multi-touch  Gave this in last presentation, but here‟s a link to the tutorial http://developer.apple.com/safari/library/documentation/appleapplications/reference/saf ariwebcontent/handlingevents/handlingevents.html  Works with iPad/iPhone/iPod and Windows 7 with Chrome & Firefox
  • 16. Web SQL Database  Can store relational data locally in the browser  Especially useful for offline apps (more later)
  • 17. Web SQL Database db = openDatabase( „testDB‟, // Name „1.0‟, // Version „Testing database‟, // User-friendly name 1000000 // Maximum size (bytes) ); db.transaction(function(tx) { tx.executeSql(„CREATE TABLE Foo (ID INT, Name TEXT)‟); tx.executeSql(„INSERT INTO Foo (ID, Name) Values(1, „bar‟); });
  • 18. Web SQL Database db.transaction(function(tx) { tx.executeSql('SELECT * FROM Foo', [], function (tx, results) { var len = results.rows.length, i; for (i = 0; i < len; i++) { var row = results.rows[i]; alert(row.ID + „ – „ + row.Name); } }); });
  • 19. Web Sockets  HTML now allows persistent connections with the server  Real-time collaboration and updates  Examples:  Stock ticker  Chat room  White board http://www.indicthreads.com/1525/building-real- time-web-applications-using-html-5-web-sockets/
  • 20. Working with Files  Using Files in Web Applications
  • 21. Offline support HTML File <html manifest=“offline.manifest”>… Offline.manifest contents (must have MIME type of text/cache-manifest) CACHE MANIFEST styles.css jquery-1.4.min.js offline.js index.html
  • 22. Detect online/offline events // standard event listeners window.addEventListener("online", function() { ... }); window.addEventListener("offline", function() { ... });
  • 23. Recommendations  Use Firefox with Firebug  jQuery is a fantastic library!  HTML5 can be used for iOS apps too!  Ask for my last presentation slides
  • 24. Conclusions  Let the web browser developers do all the hard work  Applications have never been more easy with HTML5  Great features at a great price  Develop without the need for bulky IDEs