The magic of WebSocket HTML5 coding on Android
I've been looking at ways to do real-time on-screen controls from a web client to Higgins the Android telepresence robot. I came across HTML5 WebSockets which seemed to be perfect! Real-time bi-directional data without having to write TCP code and a protocol yourself.
The problem is that the Android browser is megapants and doesn't support it. Then I stumbled across this fabulous little Python module called ws4py which, I noted, specifically mentioned it would run on Android under SL4A. I took a look at it's bundled with a seriously cool little example which I had to shoot a video of to show off.
Basically the desktop web browser on the tele in the background is viewing a page from a local Python script using the CherryPy minimal web framework. On the Galaxy Nexus a WebSocket client is running in Python connected to the desktop relaying the Android phone sensors in real time for visualisation in the HTML5 canvas on the web browser.
Now that is seriously cool.http://www.defuze.org/archives/271-ws4py-websocket-client-and-server-library-for-python.html