Websockets! See my example Tutorial: Use all Android sensors of your phone via websockets (All source incl.) - #3 by 3D-Penguin