Realtime hit counterweb stats

Archive for the 'Mobile' Category

Web Timing Specification

Friday, August 20th, 2010

The Web Timing Specification (draft) aims at providing a standard set of APIs which allow for true true end-to-end instrumentation of page load times across browsers.

To quote the w3 spec: “This specification (Web Timing Specification) defines an interface for web applications to access timing information related to navigation and elements.” The API is based on the Navigation Timing and Resource Timing interfaces, respectively.

While I haven’t seen this specification mentioned as part of the HTML5 Family before, in many ways I would consider it to be a worthy candidate for membership as it provides a standards based API through which web applications can be tested for load efficiency. This is obviously something quite useful for any web application as, the ability to precisely measure page load times – and implement optimizations as needed – affords developers the opportunity to provide an improved user experience.

Historically, the ability to acurately measure page load times of web applications has been quite challenging for a number reasons. Just knowing when and where to begin is debatable and, determining the best means of doing so can be a challenge in of itself. Regardless of any current strategies being used, the result is never entirely accurate. With Web Timing developers need not be concerned with these specifics as the API provides the ability to trully measure page load times by encompassing the full scope of loading and parsing a page. This includes the time involved to request, receive and render an HTML document.

Currently, while the specification is still being fleshed out, developers can access the Web Timing API in Chrome 6 and the IE9 preview. Work is also being done to support Web Timing in Firefox. Accessing the API from client code is implemented as follows:

Chrome:

window.webkitPerformance

IE9:

window.msPerformance

Firefox:

window.mozPerformance

Upon finalization of the specification, the Browser prefixes will be dropped, allowing for a transparent standardization across browsers.

For more information, try out the examples in the current supported browsers; IE9, Chrome 6.

The HTML5 Family

Sunday, July 18th, 2010

“If everyone is moving forward together, then success takes care of itself.” – Henry Ford

The HTML5 Family has been receiving a good deal of coverage lately, and rightfully so as many next generation browsers – specifically those in the Mobile arena based on WebKit: Android, iPhone, Blackberry etc. are now beginning to implement it’s specification, or parts thereof. On the Desktop more HTML5 support is also being seen in the latest versions of Safari, Chrome, Firefox and IE9.

Now its obvious there are some rather strong opinions regarding HTML5; some quite positive while others more negative. And while I certainly believe the notion that HTML5 will be a so-called “Flash Killer” is rather ridiculous – especially when considering the typical enterprise is far from installing the next generation of any HTML5 compatible browser, as well as DRM issues, etc. – I do believe that once everyone gets passed all of the hype the HTML5 Family will certainly play an important role in the future of the web; and currently, in the mobile Web space, that future is now.

However, and perhaps more importantly, while some developers building RIAs targeting the Flash Platform often criticize or condemn what could be perceived as a rival technology, personally, I tend to see things quite differently. In fact, I believe Flash Applications running in the browser will ultimately benefit from the HTML5 family of technologies as they can leverage them and work in tandem to provide some very interesting possibilities. So with that being said I thought I would share my seemingly unique point of view as I feel the HTML5 Family brings complimentary potential to the RIA space, but more importantly in the Mobile market, and that is certainly a context many of us will be developing for.

To a certain extent, I consider myself technology agnostic, that is, I consider myself to be a software developer with a focus on the disciplines of the User Interface Layer of what could be considered a traditional Desktop or Mobile Software Stack. To that end the Flash Platform has always been a choice platform for delivering highly scalable and maintainable RIAs. In addition to this, the HTML5 Family and it’s associated mobile frameworks, Sencha Touch in particular, present some rather compelling and exciting possibilities in the Mobile Web Space in general, and within the context of Android, iPhone and iPad specifically.

Its important to understand that every technology has its place and any technology that presents practical and exciting new possibilities within both an existing (Desktop/Web) and somewhat new (Mobile Web) paradigm is worthy of exploration or at least an informed understanding. As with the Flash Platform, the HTML5 Family of technologies presents potential for pushing the boundaries of the Web and Mobile Web. Likewise, as with Flash, the HTML5 Family has its own strengths and weaknesses. However, both technologies are quite unique in their own right. So if you are reading this and develop RIAs primarily targeting the Flash Platform, but also enjoy working with other RIA technologies, then by all means please read on, otherwise feel free to read one my many Flash Platform related posts, or stay tuned for many more to come.

A Brief Overview of the HTML5 Family

For anyone who is unfamiliar with the HTML5 Family, let me first give you a brief overview of the technologies I feel encompass what is already a rather overloaded term. In general, on a very high level, I would summarize the HTML5 Family simply as follows:

  • HTML5
  • CSS3
  • JavaScript

However, there are certainly more associated technologies which themselves further make up what could be considered the HTML5 Family, some of which are (based on current specification status):

  • Microdata
  • Geolocation API
  • Device APIs
  • Web Storage (localStorage, sessionStorage) APIs
  • Web SQL Database API
  • Web Workers API
  • Web Sockets API

HTML5

First, HTML5. HTML5 is the next major revision of HTML which aims to advance the open Web through web standards and semantically rich content. In general, HTML5 provides a content model which can be broadly defined into the following categories: Metadata content, Flow content, Sectioning content, Heading content, Phrasing content, Embedded content and Interactive content as well as form-associated elements etc.. HTML5 defines new tags such as canvas, audio, video, keygen, header, footer, nav, article, aside, datalist and more.

CSS3

CSS3 has been broken out into a collection of modules, each of which have their own specifications and are currently in various states of completion. These modules include such examples as Selectors, Transitions, Animations, Namespaces, Color, Fonts, Advanced Layout, Multi-Backround and more. Some rather amazing designs can now be created purely in CSS3.

JavaScript

Explaining what JavaScript is may seem like a moot point, however it is important to outline some key underlying specifics of the language. In particular, JavaScript is a weakly typed, dynamic, prototypal, object-oriented scripting language. Its prototypal nature is quite different from the classical concepts of traditional object oriented languages and, in order to get the most out of the language one needs to understand and embrace prototypalism and dynamism; otherwise it’s easy to (mistakenly) denigrate the language due to it’s lack of type safety and classical OO constructs.

Microdata

HTML5 Microdata provides a mechanism which allows machine-readable data to be embedded in HTML documents in the form of annotations, with an unambiguous parsing model. Microdata is compatible with numerous data formats such as JSON. Micro-data is intended to provide a standard to replace other similar concepts such as RDFa, from which browsers and other applications can discover relevant content based on the context of an applications markup. Such examples include markup for contact information, calendar events and more. This markup is understood by HTML5 compatible browsers which can then automatically offer to add the relevant content to the appropriate application. At an implementation level, microdata simply consists of a group of name-value pairs; with the groups being called items, and each name-value pair is a property.

Geolocation API

The HTML5 Geolocation API is rather straightforward; it simply provides a means by which the location of a device can be determined via a native API (as opposed to say, determining the clients IP address). The Geolocation spec is currently in last call status in the W3C.

Device APIs

Device APIs are client-side APIs which allow for direct interaction with native device services such as a device Camera, Calendar, Contacts etc.

Web Storage API

The Web Storage API allows for the persistence of local (permanent) and session based (browser session) data on the client. The API for Web Storage is extremely simple as it is based upon simple Key / Value pairs; with which Keys are simply Strings. Each site contains its own separate storage area.

Web SQL Database

While not a part of the actual HTML5 specification, the Web SQL Database presents some extremely interesting possibilities within Web Applications. The Web SQL Database provides a set of APIs which allow for the manipulation of client-side databases using SQL. The Web SQL Database is based upon SQLite (3.1.19) thus supporting the features as specified therein.

Web Workers API

Web Workers provide a mechanism by which web content can execute scripts in background threads. Web Workers allow for a much needed multi-threaded implementation for web based applications executing in a browser. While somewhat similar, Web Workers are different from threads in that they are primarily intended for executing long running, expensive computations and algorithms so as to facilitate non-blocking UI background processes. One specific aspect of Web Workers which has considerable positive implications for the web moving forward is that they run in native threads as opposed to Green Threads; as is the case in VM architectures. This is quite significant as it essentially means Web Workers can scale vertically. Considering the inevitable proliferation of multi-core desktop and mobile devices, this is certainly something that will prove advantageous.

Web Sockets API

Web Sockets provide native, full-duplex communications channels which operate over a single socket that enables HTML5 compliant browsers to use the WebSocket protocol (exposed via a JavaScript API) for two-way communication with a remote host.

If you are interested in learning more about each of these technologies I recommend the following resources:

In the weeks to come I plan to go into further detail for each of these associated HTML5 Family technologies, providing working examples, specifically from a Mobile context. Where applicable, I will contrast each technology with similar Flash Platform APIs and concepts, as well as show how they can be utilized together to create some interesting possibilities.

AIR for Android

Thursday, May 13th, 2010

As you may be aware, Adobe currently has a private beta of AIR for the Android Operating System.

Although still in it’s early stages, the core platform is quite stable and support from the AIR engineering team has been very good while the pre-release forums have also been quite active with lots of useful information being shared daily. In just a little under an hour I was able to have two POCs demonstrating the Accelerometer and MultiTouch Gesture capabilities running flawlessly on my Droid. Additionally, I was also able to develop a very basic Geolocation prototype in next to no time at all which accurately conveyed latitude / longitude, altitude and even speed. In the time since I have been focusing on real world applications and the results have been excellent for such early stages of the platform.

Some notable features I have been working with are: GPS, Accelerometer, Multitouch / Gestures, SMS/TEL URI Schemes, IME, S/W Keyboard, Screen Orientation, Screen Dimming, Menu/Back keys and more.

As the pre-release and my applications built on AIR for Android progress I will share my findings as well as provide open source APIs, code examples, videos and / or screen shots of the apps I am working on, so stay tuned for more information.

The Flash Platform and Android

Thursday, April 22nd, 2010

Rather than going into any detail regarding my thoughts surrounding Apple’s updated iPhone developer license clause last week, I instead prefer to focus on the more exciting and positive developments the future has to hold for the Flash Platform in the mobile space; and at the moment, it’s Android

As you may be aware, beginning with Adobe Flash Player 10.1, the AIR 2.5 for Android SDK and Android, the Flash Platform will now begin to close the gap in terms of developing and deploying Web, Desktop and Mobile applications. Thus it appears this could open up some very exciting possibilities in the RIA space as, a write-once, deploy-anywhere solution for Mobile, Web and Desktop applications is obviously highly desirable.

For those of you unfamiliar with Android, it is a premiere software stack for mobile devices which provides an Operating System built on the Linux kernal, a very well designed middleware layer and core applications including an E-mail client, SMS program, calendar, maps, browser, contacts and more. Android also provides an Application framework, a Dalvik virtual machine which is optimized for Mobile Devices, an integrated web browser based on the widely known WebKit engine, SQLite storage, common Media support, hardware dependent Bluetooth, EDGE, 3G, WiFi, Camera, GPS, Compass, and Accelerometer support as well as many other features.

Originally developed by Android Inc., which was later acquired by Google, Android is now governed by the Open Handset Alliance; a consortium devoted to advancing open standards for mobile devices. Currently, over 50 mobile phones are expected to come shipped with Android in 2010. Moreover, Google and their hardware partners are now shipping 60,000 Android handset units each day! If this trend continues (which it certainly appears will be the case) this equates to over 21.9 million devices shipping with Android per year.

Traditionally, getting started with Android has been quite simple for developers who have experience with Java as one need only download and unpack the Android SDK distribution and install the Android Development Tools (ADT) Eclipse plugin. Managing different Android platforms as well as other SDK components is accomplished via AVD Manager which come with the SDK. As expected, the Android SDK also comes with a very high quality device emulator which feels similar to the BlackBerry JDEs device Simulators.

While developing applications for Android with ADT is certainly convenient (and quite fun), from a Flash Platform development perspective it is much more desirable (as well as economical) for developers to leverage their existing skill-set and APIs to develop a single application targeting Flash Player or the AIR runtime that will work with any device shipped with Android. And with Flash Player 10.1 and the current private beta of Android AIR 2.0, the Flash Platforms reach will now include the Android platform. The most significant of these new possibilities is the ability to develop a single application which supports both Web and Mobile devices alike. Thus considerably simplifying the development and deployment process. Of particular interest is the ability to leverage Mobile Device specific features such as Accelerometer, GPS, multi-touch, gestures screen orientation etc. from an AIR application.

Flash Player 10.1 will support devices running on Android that meet the minimum software and hardware requirements, which at the moment appear to be devices with an ARM v7 (Cortex) processor. Both Droid and Nexus One carry ARM v7. Architecturally, I am quite interested in seeing how this all comes together in terms of memory and cpu optimization.

Working in conjunction with Adobe, as part of the Open Screen Project, Motorola is helping to develop Flash Player 10.1 so it works on Android. Motorola will also be deploying the Flash Player broadly across its Android product portfolio going forward; releasing Flash Player updates for existing devices such as the Droid (which I happen be actively developing for).

Adobe is targeting the end of July 2010 to have the Android AIR 2.0 Beta and Flash 10.1 for Android available. For updates sign up for:

  • Adobe Flash Player 10.1 Beta for Android Notification
  • Adobe AIR 2.0 Beta Android Notification