New iPad complicates life for HTML 5 developers
Apple’s new iPad, already a hit with consumers with its high-resolution display, is nonetheless underwhelming some HTML 5 developers. The tablet’s iOS 5.1 operating system complicates HTML 5 data storage, offers no expanded HTML 5 support, and the tablet’s Web performance is at best only at par with iPad 2.
It’s too much to call these “setbacks” and no one is saying Apple is reneging on its aggressive support for the emerging Web standards that will eventually let browser-based apps behave much like native apps. But for some, Apple’s decisions are a compromise they could live without.
Sencha, an HTML 5 tools vendor, last week posted its “HTML 5 Scorecard” for the new iPad and iOS 5.1, calling the results a “mixed bag” for Apple. The vendor’s scoring weighs two criteria: completeness — how much of the various HTML 5 elements are present — and correctness — how well it supports these elements, says Aditya Bansod, senior director, product management, for the Redwood City, Calif., software company. The blogpost also included results of a pair of Web benchmarks testing the new tablet’s Web performance.
“It’s still the best HTML 5 platform on the market,” says Bansod. “But we had hoped for a bigger advance than this [in the new iPad]. Instead, we’re treading water and even slid back a bit. That’s a little disappointing from Apple.”
Complicating Web data storage
One change, first introduced early in 2011 with a beta release of iOS 5.1, limits some aspects of HTLM 5 local data storage. Data that’s locally stored using the HTML 5 data storage feature, is no longer regarded by the OS as persistent. That presented a problem for developers using that feature with either localStorage or WebSQL as the storage mechanism. Because the OS no longer sees this data as persistent but temporary, “iOS can destroy it at any time, without warning, including during low memory scenarios,” Bansod noted in his blogpost.
Web developers quickly picked up on the change last January, in various online forums, including the Phonegap forum on Google Groups, which had one developer posting about his troubles as recently as April 1.
The issue affects a subgroup of iOS apps, sometimes called hybrid apps, which use an embedded WebView. “WebViews power HTML5 applications that live inside of native packages, such as PhoneGap or Sencha Touch native packaging,” Bansod writes. “They provide an embedded web browser that is hosted within a native application, permitting the distribution of web apps to native app stores. WebViews are a feature of all modern mobile operating systems.”
Until iOS 5.1, WebView apps could store data locally, and keep it persistent, using HTML 5 storage. “Specifically, if your application used localStorage or WebSQL, it was considered part of the application’s data,” says Bansod. If a new app version was released, this data was still present.
That’s no longer the case. “This is probably because Apple can’t reliably iCloud backup, or iCloud sync from anything that’s not stored in the native [iOS] CoreData storage,” Bansod speculates. One developer at the Phonegap forum say he was told by “an Apple guy” that the reason for the change was “they did that to save space, because with apps loading a lot of content into a UIWebView (like twitter), it takes a lot of space [being backed up to Apple’s iCloud service]…. But they completely forgot us, poor phonegap dev[elopers], relying into LocalStorage or WebSQL to store users data.”
In effect, apps without a workaround will “forget” data. Users might lose data too logging into a website repeatedly because their app which used use to store their relevant user data no longer does so, for example.
At least some developers hoped this change was actually a bug and Apple would fix it. On March 7, with the announcement of the new iPad, and iOS 5.1, they discovered that Apple had pushed them into some new territory. “They did it. Apple has released their app with that bug. I already got angry users that lose all their work on my app,” posted Sam at the Phonegap forum.
The workarounds have not been simple, as you can see following a discussion thread for one Phonegap plugin, created by Shazron Abdullah, at the Apache Software Foundation.
No advance in HTML 5 features
Sencha’s scorecard also found an absence of any new HTML 5 functions in iOS 5.1 and the newest mobile version of Apple’s Safari Web browser. “No new features showed up between iOS 5.0 and iOS 5.1,” he writes. “iOS still features some of the best HTML5 support on any mobile browser, but this latest incarnation hasn’t increased the depth of Mobile Safari’s support for the standards.”
Safari 6 on the Mac, for example, supports a feature called Cascading Style Sheets (CSS) regions, a way of making it simple to create and change digital magazine layouts. But it’s missing from the current Safari on iOS 5.1 devices.
As is well known, the new iPad uses a version of Apple’s dual-core A5 chip, with a new, quadcore graphics processor.
Overall, the new iPad (dubbed “Retina iPad” in Sencha’s test results) was somewhat slower in six of the 9 SunSpider tests. In the seven V8 tests, the new iPad general matched the iPad 2, but both lagged the Motorola tablet.
For most Web browsing, Bansod says, users of the new iPad won’t see any problems. But there is a noticeable difference between the two iPads when it comes to drawing complex Web pages. For example, the new iPad was visibly loading new tiles at the bottom of one sample page as the page was being scrolled, something that rarely occurs with the iPad 2, according to Bansod.
He speculates that one reason for the performance plateau in the new iPad is that while Apple added the quad-core graphics processor and more memory, it didn’t make the memory faster. That would mean, he says, that pumping images and other graphic assets into the GPU is taking more time and bandwidth “than the device can handle in real time.”
[John Cox covers wireless networking and mobile computing for Network World.]