Free Liberator
SitePen Support

Android and Comet

by Dylan SchiemannNovember 12th, 2007

Google has released the first version of their SDK for Android, an open development platform for mobile devices. Given the critical necessity of low latency data transit with mobile devices, I wanted to find out what initial support is available for Comet on the gPhone platform.

Lightstreamer Android demo

XMPP is supported through the com.google.android.xmppService package. While the emulator currently seems to be hardcoded to @gmail.com domains, it looks like it will be quite straightforward to create chat applications for networks supporting the Jabber protocol. According to the documentation, to conserve network connection resources “the system currently maintains a single XMPP connection to the server, and all XMPP traffic — including both standard XMPP instant messages, and this P2P message-passing system — is carried on the same connection.”

The web browser included is WebKit, much like that found on the iPhone or Nokia’s S60 line of devices. In our initial tests using the emulator, the standard Cometd demos are not working correctly. We’ll be testing things in more detail in the next few days to try and determine if there are issues with Cometd, Dojo client code, or interaction with the emulator itself. We do know that most of the Lightstreamer demos work as expected on the emulator! One caveat: CPU consumption is substantial with the emulator and the Lightstreamer demo, though this could be related to animations or any number of other features besides the Comet data transit.

Lightstreamer Android demo

Given that this platform really does look like the same mobile WebKit, Comet server implementations that work on the iPhone should run on Android-based phones when they are released, with some work to do between now and then.

Between XMPP and WebKit, Android seems to give us significant options for both desktop and web-based low-latency data transit within mobile applications. If I have one complaint right now, it is that the SDK is heavily biased towards Java developers. I hope that changes prior to the final release, but for now it’s really nice having an official SDK well in advance.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Free Liberator

6 Responses to “Android and Comet”

  1. Comet Daily » Blog Archive » Caplin, MochiWeb, and Android Says:

    [...] Android and Comet - Google’s new open framework for mobile devices looks promising for Comet developers [...]

  2. Lang Says:

    You mention something about “standard Cometd demos”. Are these demos available for the public? I have yet to find a demo with Cometd and/or Dojo client code :(

  3. DylanSchiemann Says:

    @Lang: there are a few hosted at SitePen. These are checked into the cometd svn for the Twisted Python version of Cometd:
    http://comet.sitepen.com:9000/tests/magnets/magnets.html
    http://comet.sitepen.com:9000/tests/iphone/

  4. Android and Comet on devphone Says:

    [...] Schiemann has written about the role of HTTP streaming and Comet with respect to Android and mobile in general: Given the critical necessity of low latency data transit with mobile [...]

  5. David Chung Says:

    Hi Dylan,

    Dylan said:
    >. We’ll be testing things in more detail in the next few days to
    >try and determine if there are issues with Cometd, Dojo client
    >code, or interaction with the emulator itself.

    I searched this site but couldn’t find any follow-up article on this subject.

    Have your investigations on why cometd fails to work on Android’s webkit browser been fruitful?

    I cannot login when I tried accessing http://comet.sitepen.com:9000/tests/iphone/ from the android emulator browser (SDK MK5, Feb 13 2008), so I guess that they still do not support comet.

    By the way, XMPP support has been deprecated in this version of Android (MK5) in favor of a gtalk proprietary binary format… I have mixed feelings on this one - while binary is indeed the way to go to minimize data transfer sizes, XMPP offered a very convenient way to implement messaging. Nevertheless, it will be mitigated if google also release the communication specifications so that third party servers can be created.

    Regards,

    David

  6. DylanSchiemann Says:

    David,

    Dojo uses synchronous XHR which apparently does not yet work in Android. So, if we do a cross-domain build which uses async XHR, our demos should work. The Lightstreamer demos work great, so hopefully we’ll get that tested and deployed soon.

Leave a Reply



Copyright 2009 Comet Daily, LLC. All Rights Reserved