Forget the empty "Web 2.0" buzzword! Web development, however, is changing. In this session, Bruce gives and overview of HTML5, its intelligent forms, scriptable images and native video. Together with CSS3 and SVG, it will change the way you work making it easier to develop exciting applications. The emergence of more and more Web-enabled devices presents headaches: do you write and test many sites for different devices, or make one site for all? Some simple techniques help you write one site to work everywhere, saving you time and grey hairs. Web development 2.0: Web workers of the world, relax!
4. "Our goal is to take the one true Web and
make it available to people on their terms."
Jon S. von Tetzchner, Opera Co-founder
"All I ask is access to the full Web, everywhere. And some more beer."
Me
5.
6. 1. new web standards
2. adaptive content
3. browser as platform
7. 1. new web standards
2. adaptive content
3. browser as platform
10. -moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
14. “...extending the language to better support Web
applications, since that is one of the directions the Web is
going in and is one of the areas least well served by HTML
so far. This puts HTML in direct competition with other
technologies intended for applications deployed over the
Web, in particular Flash and Silverlight.”
Ian Hickson, Editor of HTML5
http://lists.w3.org/Archives/Public/public-html/2009Jan/0215.html
24. Scalable Vector Graphics:
● Supported in 4 modern browsers, and IE9
● Vector graphics, therefore infinitely scalable
● XML so text-based - can be made accessible
● Keeps a DOM
● Can author with Adobe Illustrator or Inkscape
28. video format debates – Free formats vs MP4
<video controls autoplay poster="…" width="…" height="…">
<source src="movie.ogv" type="video/ogg" />
<source src="movie.mp4" type="video/mp4" />
<!-- fallback content -->
</video>
still include fallback for old browsers
http://camendesign.com/code/video_for_everybody
29. video as native object...why is it important?
● “play nice” with rest of the page
● keyboard accessibility built-in
● API for controls
Demonstration of mark-up “fallback” video in Opera 10.53,
scripted controls
31. find out your location via JavaScript
navigator.geolocation.getCurrentPosition(success, error);
function success(position) {
/* where's Waldo? */
var lat = position.coords.latitude;
var long = position.coords.longitude;
...
}
37. Web Database – full relational DB / SQL
var db =
openDatabase(dbName, version, displayName, expectedSize);
db.transaction(function(tx) {
tx.executeSql(sqlStatement, [], function (tx, result) {
/* do something with the results */
});
});
42. Opera Mini: +140% users, +200% page views
25.8 billion pages / month
3.6 petabytes of data were compressed
March 2009 – 2010
www.opera.com/smw/2010/03
44. Top 10 handsets in Poland
● Sony Ericsson K800i
●
Nokia 6300
●
Nokia 5130 XpressMusic
●
Sony Ericsson K550i
●
Sony Ericsson W890i
●
Nokia 5310 XpressMusic
●
Nokia E51
●
Nokia 6500s
● LG KU990i
● Sony Ericsson W910i
45. “One Web” is an uneven landscape:
● constrained browsers (WAP, …)
● mobile “Full Web” (Android, Opera Mobile, …)
● proxy-based (Opera Mini, …)
● laptop, Netbook, Tablet PC, Desktop
● games consoles, set-top boxes, TVs
46. Device capabilities also vary:
● screen size and resolution
● input mechanism – touch, keypad, other?
● memory and processing power
● colour palettes
● connection speed / quality
47. “One Web means making, as far as is reasonable, the
same information and services available to users
irrespective of the device they are using. However, it does
not mean that exactly the same information is available in
exactly the same representation across all devices.”
W3C Mobile Web Best Practices http://www.w3.org/TR/mobile-bp/#OneWeb
48. Approaches to cross-device development:
● do nothing – use standards, defensive design
● separate site (m.mysite.com, mysite.mobi)
● single site, but optimised for cross-device
49. Server-side detection of devices:
● “browser sniffing” the User Agent string
Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.2056/866; U; en) Presto/2.2
● offer users a way back (example of Orkut)
50. Tips for optimising for mobile/ devices:
● Use CSS3 Media Queries
● Define size of images in HTML
● Put JavaScript as far down as you can
● Reduce HTTP requests
51. CSS 3 Media Queries:
@media screen and
(max-device-width: 480px) {
// insert CSS rules here
}
http://www.w3.org/TR/css3-mediaqueries/
Demonstration of Media Queries
52. Images:
●
Images take a long time to load, so tell the browser
to leave a space for them
● If you don't, when the image finally loads, the
browser will redraw the page to fit the image in,
perhaps scrolling off screen
● Redrawing the screen wastes processor time (and
battery life)
● Some turn off images; design for accessibility
53. Images:
●
Images take a long time to load, so tell the browser
to leave a space for them
● If you don't, when the image finally loads, the
browser will redraw the page to fit the image in,
perhaps scrolling off screen
● Redrawing the screen wastes processor time (and
battery life)
● Some turn off images; design for accessibility
54. Put JS as far down the source as possible:
●
Browsers wait for JS to load. If they're at the top,
rendering pauses.
● If your JS is at the bottom of the page, the user can
read the content etc while she is waiting to interact
with the page.
55. Minimise HTTP requests:
●
Combine JS into one file. Same with CSS.
● Use CSS sprites to combine decorative images
● Consider encoding images directly in your page as
data URLs
● Use SVG or <canvas> for images
56. 1. new web standards
2. adaptive content
3. browser as platform
57.
58. “…the browser run-time is
perfect…you’re out of writing for
Windows Mobile, Android, S60,
each of which require testing...we
want to abstract that.
All the cool innovation is
happening inside the browser –
you don’t need to write to the
native operating system
anymore.”
Mobile Entertainment Market, June, 2009
59. W3C Widgets – application development filled
with web standards goodness,
using browser engine as platform
60. Anatomy of a widget
index.html, assets + config.xml,
zipped .wgt
61. 1. new web standards
2. adaptive content
3. browser as platform