Mobile Ajax, Google Gears on mobile and Offline browsing

After two big announcements from Google, i.e. OpenSocial and Open Handset Alliance/Android .. I believe that the third missing announcement is Google gears on mobile. Google gears on mobile devices would solve a key problem for the Mobile Web and I have blogged about it’s potential almost as soon as the announcement was made.

With Android, Google has not gone RIA (Rich Internet Applications) but for a large measure, the rest of the world has already gone RIA for mobile browsers. If you accept that technologies like Mobile Ajax are now becoming mainstream just within two years after my now well publicised blog about the same topic Mobile web 2.0: AJAX for mobile devices – why mobile AJAX will replace both J2ME and XHTML as the preferred platform for mobile applications development – Part two , then it is indeed time to address offline browsing in tandem with Mobile Ajax.

In a nutshell, Google Gears comprises of a local database, local processes and a web server – with the logic being written in Javascript. Hence, Gears potentially fits in well with Mobile Ajax and Gears also fits in well with Mobile Web Widgets(and by that I mean Widgets created using Web standards as opposed to Widsets and similar products)

The acceptance of common standards between the Web and the Mobile Web is a good thing and while Gears is not a ‘standard’ – it is open sourced – and it’s acceptance on the Web would definitely help to promote it on the Mobile Web. As far as I can see, the only other group/body addressing this problem is HTML5 and even those efforts appear to be mainly to be for the Web(and not the Mobile Web)

While I am a big fan of standards, W3C etc .. in this case, I think Google is leading the way. And if they do the same as they have done in case of Android(An alliance rather than ‘doing it Google’s way’) – then we have the potential of a truly interesting service.

The most logical way to implement Gears on browsers is through a plug-in such as the Netscape plug-in API followed by Mozilla, Opera and most major players(except Microsoft). I am a bit unsure about Mobile browser plugin standards(as opposed to Web browser plugin standards) but I hope to find out soon. Google may well opensource Gears on mobile just as it does on the Web creating a de-facto standard if one does not exist.

Soon, I see Mobile development to be dominated by two open source products: Google Gears and the OHA. And that is a good thing because it allows other players in the industry(including Operators, device manufacturers etc) to have a role.

For instance, If vendors like Nokia, Opera and others support Gears in their respective Rich Web browsers – then we have a good way to overcome the fragmentation issue that has ailed the industry from the outset . Furthermore, it is an alliance founded on the basis of Open source with each party playing to their respective strengths.

The one additional bit missing here is security .. as a study of Google Gears on the web demonstrates. The implementation of Google gears on the Web gives some clues of the issues involved and we can expect the same issues on Mobile devices(plus security and device APIs unique to mobile devices)

As per the Google gears architecture on the web, some of the issues involved include ..

a) The lack of a data layer: For instance, AJAX calls can originate from anywhere within the code without an interim data layer. This is fine for existing Ajax applications since the only source is the server. However, when we also have local storage, there are potentially two sources (the server and the local storage). Hence, a common data layer is needed(which currently does not exist)

b) Features available offline: Not all features may be optimal offline – for instance rapidly changing stock quotes are best accessed from the server than offline

c) Modality – Managing the transition process i.e. switching between online and offline modes(explicit or user driven)

d) Synchronization: explicit, in the background etc

And then there is security .. a major topic in itself. According to the Google Gears site

, Gears follows the same origin policy

and security at the file system level is enforced by the Operating system.

However, when it comes to Mobile devices, there is a lot more in relation to offline storage and security. For instance

• Can the browser access content from removable media?

• Can the browser read/write data from the terminal’s file system programmatically?

• What restrictions are placed on personal data(stored in the cache) for ex data types like SIM contact data, Phonebook contact data, Diary elements etc which are normally protected but can now be cached.

There have been other references to Mobile offline browsing – most notably from the Register and CEO

To conclude, sqlLite is part of Android. It is also a part of Gears. Google could easily use a similar architecture and experience gained from Android to solve the problem of persistence in Mobile Ajax applications. A problem whose resolution would help the industry and encourage the growth on Mobile Ajax/Rich Internet Applications on mobile devices.

Comments welcome as usual

update from Stefan at intomobile

Thanks Stefan!

>>>

Actually Nokia is already implementing something called the Web Runtime with their next edition of S60 that will allow devices to do what you just said: http://www.intomobile.com/2007/11/27/widgets-the-s60-web-run-time-what-is-it-and-how-can-i-use-it.html

Motorola, in their next version of Linux, is also working on a web runtime.

What you want requires platform level support, something that even the mighty google will have a hard time with unless they pull a Yahoo 2 Go and build a mobile application platform in which developers work.

Who knows, too early to tell, but I agree with your basic logic that Google Widgets + Open Social + Google Gears for Mobile makes the most sense. The key is the implementation.

<<

Comments

  1. Actually Nokia is already implementing something called the Web Runtime with their next edition of S60 that will allow devices to do what you just said: http://www.intomobile.com/2007/11/27/widgets-the-s60-web-run-time-what-is-it-and-how-can-i-use-it.html
    Motorola, in their next version of Linux, is also working on a web runtime.
    What you want requires platform level support, something that even the mighty google will have a hard time with unless they pull a Yahoo 2 Go and build a mobile application platform in which developers work.
    Who knows, too early to tell, but I agree with your basic logic that Google Widgets + Open Social + Google Gears for Mobile makes the most sense. The key is the implementation.

  2. Ian Hickson says:

    Actually, HTML5 is aimed at the Web in general, both on desktop and mobile, and anywhere else you might find it. We’re trying to remove the distinction.
    If you have any feedback on HTML5 we’d love to have it, especially if you don’t think it’s addressing the needs of the mobile space. You can send mail to our mailing lists (public-html@w3.org or whatwg@whatwg.org) if you’re subscribed, or, if you don’t want to subscribe, feel free to just drop me a mail directly (I’m the spec editor): ian@hixie.ch
    Cheers!

  3. The HTML5 APIs are heavily incluenced by Google Gears and feedback from the Gears team at Google. I believe they are planning to adopt the HTML5 APIs in due course.

  4. Ajit Jaokar says:

    Thanks Anne, Ian, Stefan. Ian – I have sent you a seperate email rgds Ajit

  5. Alan Tai says:

    Hi Ajit, dunno if you saw this already, but the W3C Mobile Web Initiative recently sponsored its first workshop on Mobile Ajax:
    http://www.w3.org/2007/06/mobile-ajax/report.html
    There’s a lot of good discussion on all your points, including architecture, offline, and security. Dave Burke also talked about Google Gears for mobile.

  6. Ajit Jaokar says:

    many thanks for this Alan. I know of this event since it was organised by Dan and Jon but could not attend it. Thanks for this link kind rgds Ajit

  7. Martin says:

    Hello Ajit,
    thanks for this very interesting blog post! What an interesting coincidence as I am just working on a chapter of my new book in which I discuss that web 2.0 applications in the web browser need some way of storing information locally and executing locally when there is no network coverage. I think this is especially important for applications such as a calendar that must be executable even when there is no network available. It is just not acceptable to look at an empty browser window :-)
    Thanks for providing excellent references, I can no go into more detail then I originally intended.
    I am especially interested in the security model since I can see a lot of good things one can do with it but also stuff I don’t want, e.g. JavaScript advertisement apps to spy on me by storing information in a local database to detect which sites I visit, etc. Also I can see a lot of good things that can be done when web apps could access local information like contacts, GPS info, etc. but again, the security model must be both very strict and easy to handle as I would only allow very few applications to access this kind of data.
    Thanks again,
    Martin

  8. Ajit Jaokar says:

    hello martin, keep me posted re yr book. happy to blog about it when its out kind rgds Aj