Subject: [hybi] Android sensors to control your webapp through WebSocket

From: Sylvain Hellegouarch <[email-masked]>
Date: Tue, 23 Aug 2011 22:15:00 +0200

Hi all,

I wrote a simple demo that I thought would be fun. Using WebSocket, I'm
sending Android sensor values to a server which broadcasts those to any
connected clients, like a browser running WebSocket. Then I'm using
JavaScript and a HTML5 Canvas to render received values in real time.

http://www.defuze.org/oss/ws4py/screenshots/droidsensors.png

Ultimately this is to show one could use a mobile device to control a webapp
a bit like a Wii control does on your TV. The communication between the
device and the server needn't to be WebSocket but I thought it'd be
interesting to show ws4py can run on Android as well.This has been tested
with Android 2.2 on my HTC Desire and Chrome 15.0.854.0 dev on Debian 6.

The code is probably rather prone to break so do not use in production ;-)

If you want to give it a try, use the last git revision.
https://github.com/Lawouach/WebSocket-for-Python

Some info on how to setup the Android client:
https://github.com/Lawouach/WebSocket-for-Python/blob/master/example/droid_sensor.py

Enjoy,
-- 
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach