2page

O’Reilly Media, Inc. 3/9/2012 • Device features, such as accelerometer and geolocation hardware, present new business opportunities with technologies like Augmented Reality. • Overall, mobile first requires you to think in a code quality mindset. Today, it’s required for developers to worry about things like battery life when doing hardware accelerated animations with CSS; This quality of development not only brings better performing apps, but it also encourages you to focus on semantics. • As you wean yourself off of desktop focused web development, mobile browsers give you a glimpse into the future. This allows you to stay on the bleeding edge and in touch with new specifications and features. Unfortunately the Mobile Web isn’t write-once-run-anywhere yet. As specifications become final and features are implemented, interoperability will be achieved. However, in today’s world of mobile browsers, we don’t have a largely consistent implementation across all browsers. And even though new tablets and phones are constantly being released to achieve a consistent level of HTML5 implementation, we all know that we’re stuck supporting these older devices for a set amount of time. So, needless to say, devices like the iPhone 3G and any device which hasn’t upgraded past Android 4 will be the IE6’s of this mobile era. At this point, you’re probably headed in one of three directions: • You wish to write a Mobile Web only HTML5 based app. • You’re looking to create a new web application for both mobile and desktop clients. • You are converting an existing application to work on mobile devices. We’ll address each of these scenarios in order, most fun to most painful. But first, we need to know what our target devices and browsers are capable of. What’s Supported As the mobile landscape exists today, we have multiple platforms and browsers to support and code for. By using core HTML5 API’s, you’re bound to what is supported by your target devices. So it’s critical to understand where the mobile browser scene is today, and where it’s headed. Writing mobile web apps, which span all platforms and all browsers, can be a huge undertaking. Previously, web app developers didn’t care if your desktop computer had a camera or accelerometer attached to it. The web applications of yesterday were not tied to the operating system and the capabilities of your desktop hardware. Now, the mobile web adds another dimension of support to the apps we build and the fragmentation across browsers and devices is mind-blowing. We must now create applications to be compatible across browsers, platforms, AND devices. For example, Android’s WebKit based browser may have supported Web Workers in version 2.1, but later disabled support in version 2.2, 3.0, and 4.0. Then it gets fixed and turned back on in 4.1! Confusing, right? This is what I mean by another dimension of support or “fragmentation”. You’re not only supporting browsers, but the operating system it’s tied to as well. But, not to worry, next we’re going to look at the browsers, find out what is commonly supported per device, and identify a core set of features which we can build a solid enterprise mobile web app from. 2