CARVIEW |
- Jason Chen’s Hands-On Review of a Google Nexus One ★
-
Jason Chen says it’s significantly faster than the Droid:
When comparing the three phones in loading a webpage over Wi-Fi, the Nexus One loaded first, the iPhone 3GS came in a few seconds later, and the Droid came in a little while after that. This was constant throughout many webpage loads, so it’s indicative of something going on inside with the hardware.
I ran all three through a Javascript benchmark engine for some quantifiable numbers, and while the results were similar between the Nexus One and the iPhone 3GS, the Droid still came up at about 60% of the other two. Surprisingly enough, Mobile Safari on the iPhone scored better on the Javascript benches than the Nexus did, even though the Nexus was able to pull down and render actual web pages faster.
- The Future: When the Editors Hire the Publishers ★
-
Choire Sicha on the inversion of authority exemplified by Joshua Marshall’s TPM Media:
My friend’s point was: here is an editor, who built and owns his publication, who is now going to be the editor-owner, who will employ the publisher. For those of you who have worked at any sort of publication, the implications of this are staggering.
Tuesday, 22 December 2009
- Lehrer’s Rules ★
-
Jim Lehrer’s approach to journalism. Hard to find anything to quibble about in the list.
- Information Is Beautiful: Climate Change Skeptics vs. The Scientific Consensus ★
-
Copiously researched and fairly presented.
- Google’s ‘Meaning of Open’ ★
-
Google senior vice president Jonathan Rosenberg published a long memo “about the meaning of ‘open’ as it relates to the Internet, Google, and [Google’s] users.”
It’s the biggest pile of horseshit I’ve ever seen from Google.
Basically, he’s spewed 4,000 words to say that “open” is always good and always wins, Google is always open, therefore Google is always good and will always win. And please don’t worry your pretty little minds about things like Google’s search or ad algorithms or the specific details of how its data centers work, all of which things Google could not possibly be more secretive about. Because if you think about these things, you’ll see that Google isn’t open at all about certain financially lucrative areas where it has built huge technical advantages over its competitors, and that’s not possible, because Google is always open.
I really hope for Google’s sake that this horseshit artist Rosenberg is not representative of their executive ranks. Also: open is an adjective; the noun form in this context is openness.
- Craig Mod’s Lumix GF1 Field Test: Video ★
-
A follow-up to Mod’s astounding travelogue-cum-camera-review, detailing the Panasonic GF1’s video capabilities.
- Auto-Buffering Video in Firefox ★
-
Christopher Blizzard of Mozilla:
Safari and Chrome do apparently autobuffer by default, but he incorrectly says that Firefox does as well. Just to be clear: Firefox does not autobuffer by default, nor does it autoplay by default. I’m not sure how his testing led him to believe that it does, but I wrote up some examples to show that it does not.
I’m not sure how my testing led me to believe that Firefox auto-buffers by default, either. But looking at his test pages using Firefox now, it’s clear that I was wrong. Firefox honors the
autobuffer
attribute, unlike Safari and Chrome. I very much regret the error, and have revised the original article accordingly.
Monday, 21 December 2009
- Why ‘Duke Nukem Forever’ Took Forever ★
-
Clive Thompson on the story behind the greatest vaporware in video game history:
It’s a dilemma all artists confront, of course. When do you stop creating and send your work out to face the public? Plenty of Hollywood directors have delayed for months, dithering in the editing room. But in videogames, the problem is particularly acute, because the longer you delay, the more genuinely antiquated your product begins to look — and the more likely it is that you’ll need to rip things down and start again. All game designers know this, so they pick a point to stop improving — to “lock the game down” — and then spend a frantic year polishing. But Broussard never seemed willing to do that.
- Blue Moon ★
-
Panic’s Dave Hayden on the history of calendars.
Why the HTML5 ‘Video’ Element Is Effectively Unusable, Even in Browsers Which Support It
Monday, 21 December 2009
[Update, 22 Dec 2009: In the original version of this article, I incorrectly reported that Firefox auto-buffers HTML5 video content by default, as Safari and Chrome do. It does not, as shown by Christopher Blizzard’s simple tests here. I regret the error, and have revised the article accordingly. For posterity, the source for the original version is preserved here. You can create a precise list of changes by doing a diff against the source for the current revision.]
I seldom post video to DF, but when I do, I refuse to embed Flash,1 I want the markup to be sane and standard, I want the video to play in popular standards-compliant web browsers, and I don’t want the video to download/buffer automatically. Here’s an example from a year ago, using QuickTime.
What you see upon page load is a poster frame (a still image), then you (the user) click the poster frame to actually download and watch the video. Here’s the markup I used then:
<embed
width="320" height="256"
type="video/quicktime"
pluginspage="https://www.apple.com/quicktime/download/"
src="dtk-panic-1-poster.jpg"
href="dtk-panic-1.mov"
target="myself"
controller="false"
autoplay="false"
scale="aspect"
/>
That markup met all of my aforementioned desires but for one: the <embed>
tag is not standard. Worse, it now has a new significant problem: it doesn’t work at all in Chrome (at least on the Mac).
So I’ve been paying attention to the new <video>
element in HTML5. In a nut, it attempts to make embedding a video in a web page just as easy markup-wise as embedding an image with the <img>
tag. (Likewise for audio with the new <audio>
element.)
The obvious downside to relying solely on the <video>
element to embed web video is that because it’s new, the only browsers that support it are recent releases of Safari, Firefox, and Chrome. This isn’t one of those things that just doesn’t work in IE6 or IE7 — it doesn’t work in IE period. Therefore few sites are using HTML5 video in production now, and of those, nearly all are doing so with fallback markup, often of significant complexity, that presents the video using a Flash player for other browsers. Because (a) I don’t post much video; (b) the overwhelming majority of DF’s audience is in fact using an HTML5-compatible version of Safari, Firefox, or Chrome;2 and (c) I’m willing to be a dick about this; I do not care about fallbacks for browsers that don’t support <video>
.
What I’d like to do is just use <video>
, with two source elements — MP4 and OGV — for all the cross-browser reasons specified in Mark Pilgrim’s fine chapter on video in his in-progress HTML5 book. (Short version: Safari and MobileSafari support only MP4, Firefox supports only OGV, Chrome supports both MP4 and OGV.)3
So I decided to try this last week with the screencast videos I created to illustrate my piece on PastryKit. I tried markup like this:
<video height="475" width="407" controls poster="iphoneguide-mac.png">
<source src="iphoneguide-mac.mp4" type="video/mp4" />
<source src="iphoneguide-mac.ogv" type="video/ogg" />
</video>
The good news: The above markup results in video that plays in Safari, Chrome, and Firefox. It also works perfectly in MobileSafari on iPhone OS. Safari and Chrome play the MP4 video, Firefox plays the OGV. (Chrome supports both formats, and plays the one listed first. I want it to play the MP4 version because the video and audio are of noticeably superior quality.) That is the entirety of the necessary markup; if you’re unfamiliar with the sort of nasty markup typically used to embed video, try a little View Source on a few web pages that embed video.
The bad news: In two of the three browsers (Safari 4.0.4 and Chrome 4.0.249.43), with the above simple markup, the video content buffers automatically on page load. What I mean is that as soon as you load the web page, the browsers download the actual video files that are embedded. As stated at the outset, I don’t want that. Instead, on page load, I want the browser to render only the poster image, and load the video only after the user has clicked to initiate playback.
The HTML5 spec defines an autobuffer
attribute for the video and other media elements (bold emphasis added):
The
autobuffer
attribute is a boolean attribute. Its presence hints to the user agent that the author believes that the media element will likely be used, even though the element does not have anautoplay
attribute. (The attribute has no effect if used in conjunction with theautoplay
attribute, though including both is not an error.) This attribute may be ignored altogether.
Firefox honors the autobuffer
attribute. Omit the attribute from your markup, and video content will not auto-buffer in Firefox. Include it, and it will.
But alas, in my testing, Safari and Chrome take the spec up on the aforebolded offer to ignore this attribute. Even if you do not explicitly turn this attribute on, Safari and Chrome will still auto-buffer the content for your <video>
(and <audio>
) elements. There is no way to suppress this using HTML markup.
You might be thinking, “Hey, but default auto-buffering sounds like a good feature, because that way users won’t have to wait as long for the video to be ready to play.” I presume this sort of thinking is what led the Safari and Chrome teams to do this.
But this browser behavior is very much undesirable for both publishers and users in common contexts. Users loading the page over a slow connection, or a pay-by-the-megabyte metered connection (which is common with wireless networks), should not be forced to download a potentially large video every time they load the page. Likewise, publishers should not be forced to pay for the bandwidth to transmit videos that won’t be watched.
Think, in particular, of the nature of publishing embedded video on a weblog. I, the publisher, post an entry containing embedded video. That post may remain on my home page for a week. Regular readers may load the home page dozens of times during the period when the video appears on the page. With auto-buffering, they’re going to download the full video every time they load the page. Local caching may alleviate some of that, but for sites with high traffic and/or which frequently embed video, the difference is enormous.
This is why embedded video from YouTube, Vimeo, and all similar services works on a click-to-load basis. Auto-buffering is fine as an optional attribute, but for many (probably most) contexts, click-to-load is essential behavior.
But as far as I can see, there’s no way to get click-to-load video in Safari or Chrome using just a <video>
element. The only workaround I could think of was to do something like this:
- In the HTML markup, rather than a
<video>
element, instead use an<img>
element with the intended poster frame. - Add an
onclick
JavaScript handler to the<img>
element, which, when invoked, does some DOM jiggery-pokery to remove the just-clicked-upon<img>
element and replace it with a<video>
element that sources the intended video files.
And, in fact, that is exactly what I resorted to for my PastryKit videos. Do a View Source on that page to see the solution. There goes the nice clean just-as-easy-to-include-a-video-as-an-image markup. (My sincere thanks to Faruk Ateş and Paul Irish for helping with the jiggery-pokery implementation.)
This WebKit bug filed back in April indicates I’m not the first person to stumble on this shortcoming. That’s about <audio>
instead of <video>
, but the principle is exactly the same. And the example cited in this bug report seems like a perfect scenario where everyone should agree that media content should not buffer automatically: a podcast archive page with an <audio>
element for every previous episode.
A big part of the appeal of the <video>
and <audio>
elements is that they should be easier to use. As it stands today, though, these elements are unusable in popular contexts without resorting to JavaScript DOM manipulation to effectively turn auto-buffering off.
I think the HTML5 spec should be changed such that the value of the autobuffer
attribute must be respected. And even if the spec is not changed, web browsers should not choose to ignore it. Web browsers should only buffer HTML5 media content when the autobuffer
or autoplay
attribute has been explicitly turned on in the markup. ★
-
As for why I refuse to embed Flash, let me put it this way. I use and highly recommend ClickToFlash, which blocks all Flash content by default. Why would I publish content using a technology that I personally block by default? I truly hope to see Flash fade as the de facto standard for embedded web video, and I’m willing to put my markup where my mouth is. ↩
-
As of this writing, Daring Fireball gets about twice as many page views from MobileSafari as all versions of Internet Explorer combined on a typical weekday. ↩
-
Having to include separate source elements of the same video content encoded in two different formats is indeed an inconvenience. Not so much the extra markup as the extra work producing and encoding the second video file. Even the short videos I created to illustrate my PastryKit piece took a few minutes each to encode. Relative to most computing tasks today, encoding video once is already painfully slow. Encoding it twice is a time sink no one needs. But that’s the way it stands. ↩
Monday, 21 December 2009
- The Known Universe ★
-
Neat movie from the American Museum of Natural History: zooms out from the Himalayas in Tibet to the entirety of the known universe.
Sunday, 20 December 2009
- Best Sign Yet That AT&T’s Days as Exclusive iPhone Carrier Are Numbered ★
-
iPhone call reliability has become a punchline.
Saturday, 19 December 2009
- Andy Ihnatko’s E-Book Reader Gift Recommendations ★
-
His top three: Sony Reader Pocket Edition, Amazon Kindle 2, and the iPod Touch.
Friday, 18 December 2009
- Psystar Shuts Down ★
-
So much for this being “far from over”.
Update: Psystar attorney (paraphrased): “It’s just a flesh wound!”
- Browser Pong ★
-
Just what it says on the tin.
- 70-Minute Video Review of ‘Star Wars: The Phantom Menace’ ★
-
I know, a 70-minute long video review of The Phantom Menace sounds nutty. And, when you start the first segment, you’re going to be tempted to close the tab when you hear the guy’s voice. But trust me, stick with it, it’s worth it. Amusing and genuinely astute regarding the differences between the two trilogies.
- Verizon’s Solution to Loose Droid Battery Covers ★
-
A sticker.
- Keyboard Maestro 4.0 ★
-
People sometimes ask me whether I have any — for lack of a better term — secret weapon software to recommend. Utility apps like, say, LaunchBar or Quicksilver (on that one, I’ve been in the LaunchBar camp for a few years). The sort of apps Batman would keep in his utility belt if his utility belt were a metaphor-stretched Macintosh.
Keyboard Maestro is such an app. It’s several utilities in one: a powerful macro program, a clipboard history manager, a hot key manager, a keyboard switcher, and more. Version 4 is a great update, including a complete overhaul of my very favorite Keyboard Maestro feature, the clipboard history, and an all-new Automator-esque UI for the macro editor. Keyboard Maestro is copiously documented and comes from one of the longest-standing and most-respected indie Mac developers, Peter Lewis’s Stairways Software. I recommend it highly.
- BusinessWeek: ‘Verizon Wireless Prepares for the iPhone’ ★
-
Don’t get all excited — the story is about Verizon Wireless CTO Anthony Melone claiming that Verizon could handle the traffic, not any sort of announcement of a deal with Apple. But it’s interesting nonetheless:
Melone credits the company’s reputation to a focus on high network standards backed by consistent investments and a sophisticated troubleshooting program. Over the last three years, the company has invested nearly $19 billion in its wireless network, or about $6.3 billion a year. “It comes down to backing that process with money,” says Melone. “We’ve been more consistent than any carrier in the last 10 years investing year over year.”
Here’s a [graph comparing Verizon’s and AT&T’s capital expenditures as a percentage of operating income][g]. Verizon has done things like build out a FIOS network, too, but it seems hard to dispute that Verizon spends more on its network infrastructure than AT&T.Update: Dumb mistake on my part: Verizon Wireless is not Verizon, so this chart is not a useful comparison. Verizon Wireless is a joint venture between Verizon and Vodafone, split 55-45 between the two.
- Regarding Kindle Sales ★
-
Tom Johansmeyer at BloggingStocks:
It wouldn’t reveal the number, but Amazon did announce that it realized record sales for its Kindle e-reader this month. And, there’s still the rest of the month to go, including the run-up to Christmas. Just as the battle for e-reader market share began to flare up, it already seems to be over.
Seems a little early to call this race, especially since Amazon has never revealed Kindle sales numbers.
- Google on Their Iterative Improvements to Gmail Mobile Web App ★
-
Alex Nicolaou of Google:
As of today, and thanks to numerous optimizations, I’m happy to report that Gmail for mobile loads 2-3x faster than it did in April. In fact on newer iPhone and Android devices, the app now loads in under 3 seconds. So yes, the mobile web can deliver really responsive applications.
Google’s mobile Gmail app is a fine example of a well-made and popular mobile web app — more mobile-WebKit-optimized than iPhone-optimized, insofar as it’s designed to turn equally well on both iPhone OS and Android. But it’s another one where it clearly isn’t as polished UI-wise as a native iPhone app. Its toolbar is a real hack — scrolling as you scroll the page, and then moving itself to the top of the screen when you finish scrolling.
- iPhone Has 46 Percent of Japanese Smartphone Market ★
-
These numbers must be wrong. Wired’s Brian X. Chen explained to us back in February how the iPhone wasn’t good enough to meet the high standards of the Japanese.
More on PastryKit
Thursday, 17 December 2009
A bit more regarding PastryKit, Apple’s web framework for creating iPhone web apps with a look and feel very close to that of native iPhone apps.
Apple’s Various JavaScript Frameworks
Jonathan “Wolf” Rentzsch posted this terrific overview of the known JavaScript frameworks in use by various teams at Apple today. Some are public. Others, like PastryKit, are not. There’s a bit of overlap between them; in particular, several of them are very much patterned after Cocoa, not just in terms of MVC, but right down to details like class names. (I hadn’t heard of Gianduia before, but it seems very deep. Apple’s online retail team is using it for things like the Genius Bar reservation system.)
But PastryKit is the only one that’s specifically targeted at building native-style iPhone user interfaces. Of the others, one does seem closely related to PastryKit: TuneKit, the now-public framework for building iTunes LP and iTunes Extras content bundles. About 40 percent of the code in PastryKit and TuneKit is identical (if you discount the difference between the “PK” and “TK” class name prefixes). DF reader Greg Sadetsky emailed with the following comparison, after running the code through a prettifier to de-minimize it. First, this from PastryKit:
const PKTransitionDefaults = {
duration: 0.5, delay: 0,
removesTargetUponCompletion: false,
revertsToOriginalValues: false
};
const PKTransitionStyles = [
"-webkit-transition-property",
"-webkit-transition-duration",
"-webkit-transition-timing-function",
"-webkit-transition-delay",
"-webkit-transition"
];
And then this identical-but-for-the-PK/TK-prefixes bit from TunesKit:
const TKTransitionDefaults = {
duration: 0.5, delay: 0,
removesTargetUponCompletion: false,
revertsToOriginalValues: false
};
const TKTransitionStyles = [
"-webkit-transition-property",
"-webkit-transition-duration",
"-webkit-transition-timing-function",
"-webkit-transition-delay",
"-webkit-transition"
];
Et cetera. Either PastryKit and TuneKit are sibling projects, or they’re the work of the same person. (Also, Daniel Dilger found references to “PastryKit” in the Wall-E iTunes Extras bundle back in September.)
iDisk Help
A few readers emailed to point out another instance of PastryKit in action: the help pages for the iDisk app for iPhone OS. If you have the iDisk app from the App Store installed, you can see this by tapping “Settings”, then “iDisk Help”. Looks just like the rest of the app, but there are a few tell-tale signs that it’s PastryKit running in a full-screen web view (e.g. tapping on the status bar doesn’t scroll to the top).
Is PastryKit a Leftover From the Pre-SDK Days?
One common question I’ve seen (for one example, in this Hacker News thread) is whether PastryKit could be a leftover from the “web apps are a really sweet solution to creating iPhone software” days. I’d say no. For one thing, there’s always been a user guide, and as I recall, the guide has always sort of basically followed the look-and-feel of a native app, but this current version for iPhone OS 3 is much better. In fact, if you set your user agent in Safari to MobileSafari 2 (rather than 3) and then load the User Guide you get an older version from iPhone OS 2.0, and it is far less impressive technically. No scrolling magic, no iPhone-style blue gradients when highlighting selected list rows, etc. Further, PastryKit takes advantage of features in mobile WebKit that were only added in iPhone OS 3.0. PastryKit is new.
Apple’s Take on Web Apps Competing With the App Store
Lastly, there’s the question of how concerned Apple is, strategically, that a robust web app API and market would take away from the App Store. And if so, are they worried about the money? I’d guess probably not. I don’t think Apple’s 30 percent cut of App Store revenue is anything to sneeze at, and it’s growing fast. But there’s no question that the App Store exists to sell iPhones and iPod Touches, not the other way around.
A bigger concern might be the fact that web apps are cross-platform. Apple is currently using user-agent detection to prevent its PastryKit user guide apps from loading on anything other than MobileSafari, but I don’t think there’s any technical reason why these apps wouldn’t work just fine, and look almost the same, on both Android and WebOS. The font would be slightly different, since neither of those ship with Helvetica, but otherwise it’d look just like an iPhone app.
Cutting edge web development never seems to “just work” across different browsers, but these three — iPhone, Android, WebOS — are all based on the same WebKit rendering core. And even if per-platform tweaks are required, surely it’d be far less work than to develop separate native apps using the fundamentally different Cocoa Touch, Android, and Mojo APIs.
I would hope Apple isn’t concerned about this. For one thing, desktop-targeted web apps haven’t dampened demand for Macs. If anything, the Mac has thrived as the web has replaced Windows as the most widespread software platform. I think Apple would do well to encourage web apps for cross-platform mobile software, and that doing so would not slow interest in native Cocoa Touch development for performance (especially games) and access to hardware (like the camera) not available to web apps. I also think it would benefit both iPhone users and Apple itself to have no-approval-necessary web apps thrive as an alternative to the tightly-controlled App Store.1 It’s human nature to emphasize conflict and drama, but there’s no reason why native iPhone apps and iPhone-optimized web apps can’t both be thriving, growing platforms.
But, well, we don’t know. ★
-
That’s not to say more capable web app APIs would be a panacea for all that ails the App Store. For one thing, many of the apps that Apple has blocked from the App Store couldn’t technically be reproduced as web apps. Google Voice, to name the most infamous example. For another, it isn’t much solace to a developer who just created an entire working native iPhone app in Cocoa Touch to be told that their work will not be published in the App Store but that they’re free to recreate the app from scratch using entirely different APIs and technologies. ↩
Thursday, 17 December 2009
- Craig Mod: 16 Days in the Himalayas With a Panasonic Lumix GF1 ★
-
I love this: a photo essay and camera review together in one piece. Truly remarkable. Regarding the advantages of small viewfinder-less cameras, Mod writes:
About halfway through the trip I realized something strange was happening — the people I photographed were looking me in the eyes. Indeed, they could see my eyes! I had spent so long traveling with a DSLR strapped to my face that I had forgotten about true eye contact.
For better or worse, a camera without a viewfinder is less intimidating. You are no longer half-human half-camera. You’re all human with a tiny play thing in your hand.
So true.
- Palm’s Project Ares ★
-
Palm launches public beta of their IDE for writing Mojo apps for WebOS. The whole thing is browser based — works in Safari, Chrome, and Firefox — and looks pretty slick.
- Disappointing Quarter From Palm ★
-
It’s safe to say at this point that the Pre, although not a dud, is not a hit. And Palm needs a hit.
- Strong Quarter From RIM ★
-
And strong guidance for next quarter.
- Apparent Software’s Problems With PayPal ★
-
Horrendous.
- More From Fake Steve on AT&T ★
-
More Dan Lyons than “Fake Steve” in this one:
But at some point, and I think it will be soon, the network operators will have to compete, for real, based on quality of service.
The fact that AT&T is already bonking, here in the first five minutes of a 60-minute game, is terrifying. It’s their own fault, of course. Go look at their financial statements and open up the Financial Operations and Statistics Summary and look at capital expenditures over the past eight quarters. I’m no math whiz, but it looks like capex has gone down by about 30% over the time period. Scroll down a bit to the Wireless section and check out data revenues — they’re up 80% over the same period.
There’s simply no excuse for the quality of service AT&T is providing.
- Chromium Bug Report: Close Tab Button on the Wrong Side ★
-
Google’s Nicholas Jitkoff on the placement of Chrome’s tab’s close buttons on Mac OS X:
We have decided to keep the close boxes on the right to avoid having them compete with favicons.
Safari doesn’t include per-tab favicons, so there’s no reference design from Apple. I say put the favicon on the left, and have it (the favicon) change into a close button when the mouse hovers over the tab. (Adium does this, but with IM status indicators rather than favicons.) Safari already only shows the tab close buttons when you hover. Update: iChat puts its close-this-chat buttons on the right, but iChat doesn’t have tabs — it has a sidebar list.
- There Is No Page Fold ★
-
True. (Via Sam Soffes.)
- The Bygone Bureau’s Best New Blogs of 2009 ★
-
A slew of great new sites.
- Give Me Back My Google ★
-
Re: today’s prior link on crummy Google search results, Give Me Back My Google is a front end to Google web search by Oliver Humpage that filters out affiliate link and product comparison sites from the results. (Via Kevin Maguire.)
- Andrews & Dunham Damn Fine Tea ★
-
My thanks to Andrews & Dunham Damn Fine Tea for sponsoring this week’s DF RSS feed to promote their damn fine tea. They’ve got high standards, eschewing the shotgun approach and instead offering just a few limited-edition varieties of tea at a time. And they have wonderful, stylish branding and packaging to match their high-quality product. Order now for a last-minute holiday gift idea.
- Paul Kedrosky on Google’s Crummy Search Results for Appliances ★
-
Paul Kedrosky:
Over the weekend I tried to buy a new dishwasher. Being the fine net-friendly fellow that I am, I began Google-ing for information. And Google-ing. and Google-ing. As I tweeted frustratedly at the end of the failed exercise, “To a first approximation, the entire web is spam when it comes to appliance reviews”.
I’ve noticed this too, for numerous competitive areas of consumer products. And Google’s conflict of interest is clear: all of the spammy pages clogging the results for such searches display AdWords or other keyword-based advertising. What would solve the problem — but Google is unlikely ever to offer — is an option to show results only from pages that don’t have keyword-based ads.
- Counternotions: ‘Google’s Mad Dash to Microsoftdom’ ★
-
Kontra on just how Microsoftian Google is starting to look from a strategic standpoint. He makes a good point about the potential for the Nexus One to piss off existing Android licensees — it could drive them back into the arms of Microsoft and Windows Mobile, even though Windows Mobile was the stated rival of Android at the outset.
What’s happened, of course, is that in the two years since Android was announced Windows Mobile has collapsed and the iPhone is on a meteoric rise.
Wednesday, 16 December 2009
- Zune HD Twitter Client: Shitty Performance, Censors Swear Words ★
-
What a joke.
- Iron Man 2 Trailer ★
-
They had me at Garry Shandling.
- Regret the Error’s 2009 Year in Media Errors and Corrections ★
-
One of my very favorite year-end list traditions. (Via Jim Coudal, who spotted one of the best.)
- CatPaint: Top Selling App in the iTunes App Store ★
-
Well, in Vietnam. Interesting to see how little action there is in the Vietnamese store.
- Shop at Amazon and Support Daring Fireball ★
-
We’re all running out of time here on holiday shopping season. Do your last-week shopping after clicking this link and I’ll get a nice kickback. Remember: mindless consumerism is the reason for the season.
PastryKit
Tuesday, 15 December 2009
One of the recent themes here has been the topic of iPhone OS web apps — apps for the iPhone and iPod Touch that are built with nothing more than HTML, CSS, and JavaScript. And specifically, the issues of how good an experience iPhone web apps can offer, and how easy they are to develop, compared to native Cocoa Touch apps.
One area in particular where iPhone web apps fall short of native iPhone apps is scrolling. Take for example a long list, such as your full address book in Contacts, or all your songs in the iPod app. When you scroll these lists, you can fling the list, and the list will scroll at high speed after you let go. The effect is sort of like spinning a wheel with very little friction. With iPhone web apps, you can make a list that looks almost, maybe even exactly, like a native iPhone list view. But all web views on the iPhone scroll with almost no momentum. You can’t fling them. iPhone web views feel like they have a lot of scrolling friction.
This friction might make sense for regular web pages rendered on the iPhone’s small screen, where by “regular” I mean “not optimized specifically for display on the iPhone”. But it just feels slow — stuck — on iPhone-optimized apps.
If you’ve never taken notice of it, try it now, comparing something like your Contacts app list with an iPhone web app like Showtime. (In Showtime, tap “Watchlist” and then tap the “+” button to get a nice long list to scroll through.) Another good scrolling comparison: native iPhone Twitter clients like Tweetie and Birdfeed versus iPhone web app Twitter clients like Hahlo and the new Mobile Twitter. The difference is significant, and far more than cosmetic. As Justin Williams recently wrote:
I believe that with the current crop of Web technologies available in MobileSafari, apps like Hahlo, PocketTweets and Showtime could thrive as an alternative to their native counterparts if Apple allowed developers to adjust the scrolling/drag coefficient of Mobile WebKit. If you compare the scrolling speed of your Twitter timeline in Hahlo and Tweetie, the results are drastically different. Tweetie feels like it effortlessly scrolls based on how much momentum you exert in the scroll action, while Hahlo is being constrained by a fifty pound weight on its back.
Scrolling isn’t the only UI/experience issue where web apps seemingly can’t quite match what native iPhone apps can offer. Another is that MobileSafari doesn’t allow for CSS fixed-position elements, which means you can’t make a toolbar that stays put at the very top or bottom of the screen without having it scroll away when you scroll the content.
And that’s just talking about the user experience side of things. The other side is that of development. Last month I wrote:
When you write a Cocoa Touch app for the iPhone, you’re not starting from scratch. You’re starting with the Cocoa Touch framework. As Faruk Ateş astutely points out in his response to Koch, to discount the framework is to discount everything that sets the iPhone apart as a development platform. Not only are native iPhone apps faster and more capable than their web-app equivalents, but they’re easier to write.
Some readers objected to this, arguing, more or less, that no matter how good the Cocoa Touch framework is, native iPhone apps are harder to develop than web apps because one must learn both the app framework (Cocoa) and a new programming language, Objective-C. But that’s not really a fair comparison. It’s like saying it’s easier to run than to bike if you don’t know how to ride a bicycle.
Let’s clarify. Let’s specify that we’re talking about creating iPhone apps with great design and user experiences. Let’s acknowledge that to make anything great — anything at all, software or otherwise — one needs talent, experience, and familiarity and expertise with the necessary tools. If you’re already an expert web developer but have never programmed Cocoa software, then yes, there’s large time-consuming Step Zero in front of you before you can attempt to develop a native iPhone Cocoa Touch app. But, likewise, there are long-time Cocoa Mac (and a handful of even longer-time NeXT) developers who have no idea how to create a modern AJAX-y web app from HTML, CSS, and JavaScript — and who think JavaScript is the weird programming language.
What I’m saying is that talented Cocoa Touch developers have an easier job implementing the same iPhone app than talented web app developers do. The Cocoa Touch framework makes all sort of things free or easy. Things like smooth fast animation between views. Things like buttons and lists and toolbars that look just like other standard iPhone buttons, lists, and toolbars.
There do exist some open source frameworks for iPhone web app developers, so that one need not start from scratch implementing things to mimic Cocoa Touch UI elements. iUI, started by Joe Hewitt just a few weeks after the original iPhone debuted in July 2007, is one. jQTouch, by David Kaneda and based on jQuery, is another. (Showtime is built using jQTouch.)
But these frameworks don’t solve the problem with scrolling speed/friction, or fixed-position elements.
It ends up there is a company, however, that has developed an amazing iPhone web app framework which:
Completely hides the address bar, even when running not from a saved-to-the-home app icon, but within a page in MobileSafari itself.
Allows for fixed-position toolbars that never budge from the top when you scroll.
And: sets its own scrolling friction coefficient, allowing you to fling long lists.
The company behind this web framework is Apple. And the framework is apparently named PastryKit.
The Best iPhone Web App in the World
If you have an iPhone or iPod Touch handy, stop reading this and go here:
https://help.apple.com/iphone/3/mobile/
This is not a secret web site. In fact, it may well already be in your iPhone bookmarks — it’s where you get redirected when you choose the “iPhone User Guide” bookmark that’s included as one of the defaults for MobileSafari. I don’t know when Apple launched this PastryKit-powered version of the site, but it’s been under our noses for a while, with very little notice.1
If you don’t have an iPhone or iPod Touch handy, or if you do and you’re back after trying it out and want to poke at it with Safari’s Web Inspector, you can also load it in Mac or Windows Safari by setting the user agent string to MobileSafari 3.x in Safari’s Develop menu. (Without the MobileSafari user agent string, you’ll get redirected to a different iPhone help page; using a MobileSafari 2.x user agent string, you’ll see last year’s version of the User Guide, which is far less impressive technically.) Shrink your Safari window down to roughly iPhone dimensions before loading the site, because the UI will be laid out to fill the dimensions of the viewport when it loads.
The JavaScript source code has been minimized/optimized, but it’s not obfuscated, per se, so it’s easy to see that the framework is called PastryKit, and even a dilettante JavaScript hacker like me can follow along and see some of what’s going on. PastryKit accomplishes all three of the aforementioned things — hiding the MobileSafari address bar, providing fixed-position toolbars, and providing scrolling with momentum — by disabling regular scrolling and setting up its own view hierarchy and implementing its own scrolling.
From WebKit’s perspective, everything in this iPhone User Guide is in a view that is exactly the size of the viewport, so there’s nothing to scroll. PastryKit handles all of what the user sees as scrollable content. This is how on the iPhone it provides for lower-friction scrolling than provided by MobileWebKit itself — PastryKit does its own scrolling math. And it’s even more noticeable when running the app in desktop Safari with the user agent trick, because you never see Mac scrollbars, and can’t use your mouse scrollwheel to scroll the content. Everything related to scrolling is implemented within the app itself, in JavaScript.
After installing the User Guide app to your home screen and launching it from there, there’s really very little to suggest that it isn’t a native iPhone application. No MobileSafari address bar at the top, no MobileSafari toolbar at the bottom. Scrolling is fast and has momentum. It even works perfectly offline, because the contents of the user guide are stored locally in a database using HTML5.
It’s not perfect. Scrolling is smooth on my iPhone 3GS, but it’s a little janky on my old iPhone 3G and original iPhone. (Still better than the scrolling in any other web app I’ve ever seen, though — just not native-app-smooth.) Taps and gestures sometimes don’t register — this is most noticeable for me when I try to scroll as fast as I can with a quick finger swipe. Super-quick gestures, I suspect, sometimes slip through the JavaScript event filters.
The rubber-band “bounce” scrolling — where if the view is already at the top but you pull down in an attempt to scroll up and you see whitespace and it all just bounces back into place when you let go — breaks if you pull down all the way off the bottom of the display. What happens there is the view gets “stuck” in the position where it’s displaying the stretched-out whitespace at the top of the view; you can unstick it by just tapping somewhere in the content area.
And, lastly, it doesn’t work at all with the iPhone’s system-standard gesture where you can tap the status bar at the top of the screen (the bar that displays the carrier name, signal strength, time, and battery life) to scroll to the top. In MobileSafari, if you tap the status bar while running this app, the entire MobileSafari view scrolls to the top, which exposes the browser address bar. When running the User Guide app from the home screen, tapping the status bar simply has no effect. I presume the problem here is that there is no JavaScript event in mobile WebKit for status bar taps — the event goes to the iPhone app, and the web app running in WebKit inside the iPhone app can’t see it or register a handler to act upon it. From a user’s perspective, an iPhone web app launched from the home screen is just another app. But technically, it’s like a meta app — it’s a JavaScript app running inside a native iPhone app that just presents a full-screen WebKit view and loads the web app.
But on the whole this User Guide app and the PastryKit framework are rather amazing. The $64,000 question, though, is whether PastryKit is something Apple intends (or that a team within Apple hopes) to ship publicly. It seems like a lot of effort to build a framework this rich just for this iPhone User Guide, so I’m hopeful the answer is yes. Perhaps something integrated with the next major release of Dashcode? And, perhaps with integrated UI layout tools, along the lines of Interface Builder?
Here’s to hoping we haven’t heard the last of PastryKit, and that Apple continues work on making mobile WebKit an open alternative to the App Store.
PastryKit / iPhone User Guide Demos
For the sake of posterity and for those of you without access to an iPhone or Safari, I’ve made two screencasts showing the iPhone User Guide web app in action. ★
-
There’s a question on Stack Overflow from October 22 asking about PastryKit, and jQTouch developer David Kaneda has mentioned it a few times on Twitter, but those are the only references to it I’ve been able to find. ↩
Shop at Amazon.com and support Daring Fireball
Linked List | Display Preferences
Copyright © 2002–2009 John Gruber