Skip to content


What Web Developers Should Know about Mobile Safari’s iOS 4.2 Update

With the release of the iOS 4.2 update yesterday, the major focus was on all the new features iPad users would receive – folders, multitasking and a unified inbox, to name a few. It also offered two major new features for all iOS users (iPhone, iPad and iPod Touch) – AirPlay and AirPrint, the former for streaming content between Apple devices and the latter for printing from mobile devices to networked printers.

However, flying under the radar a bit, was an update to Apple’s mobile Safari browser. And for Web developers, this update may be the most important of all.

Sponsor

Web developers, especially those turning to HTML5 as the platform for building mobile applications, will be interested to learn that mobile Safari now includes several major changes regarding its support for HTML5 and W3C standards, including added WebSockets support, accelerometer support, new JavaScript data-types and better SVG support.

These features are just now being officially documented by Apple, but Maximiliano Firtman, a mobile consultant and O’Reilly book author, detailed the changes on his blog prior to Apple’s release of its own documentation.

According to Firtman, he has detected the following changes:

  • Accelerometer & Gyroscope support through the DeviceOrientation API
  • WebSockets API from HTML5
  • Updated HTML5 Form Support
  • Partial XHR-2 Support
  • Print Support
  • New JavaScript data types
  • New DOM events
  • Enhanced SVG and Canvas support

The first item in that list – accelerometer and gyroscope support, is perhaps one of the most notable of all in terms of Web development. Until now, iOS Web developers didn’t have access to the accelerometer sensors or the magnetometer or gyroscope on some devices, writes Firtman. Now Apple is allowing access to both the accelerometer and the gyroscope APIs in iOS 4.2.

You can see an accelerometer demo in this video below (test yourself at http://ad.ag/wjmtgt):

Also, with support for WebSockets, developers of chat and other real-time applications can reduce AJAX periodic calls, explains Firtman, by using this W3C HTML5 API.

HTML5 form support has been updated, there are new supported DOM events and Canvas and SVG support has been improved, too.

Firtman’s post is filled with details on this and all the other new features Web developers will want to know about. It’s a must read (along with the official documentation of course) for all iOS developers.

(Via Mark Pilgram, John Gruber)

Discuss


Posted in General, Technology, Web.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.