AIR 2.0 has support for UDP sockets, which allows you to send and receive messages using the Universal Datagram Protocol. This means that you can communicate with other applications without the need for an extra server.
I used RemoteDroid for this demo, which is an Android app that turns your Android phone into a remote control, using your own wireless network. Originally, the app gives remote access to native applications on your computer and simulates the mouse - moving it and pressing left and right buttons - but you also need to download a server on your computer to make that work.
However, since AIR 2.0 supports UDP, you don't need an extra server to make your Android phone communicate with an AIR app. In this video, I made the AIR app listen for UDP messages sent by the Android app, to control a paperplane in a Papervision3D scene. So basically, you can turn your Android phone into a game controller.
RemoteDroid has just been open sourced, which gave me a chance to take a look at the source code of the Android app. I added the accelerometer data of the phone to it (locally, I didn't contact the owner of the project yet), and in the video you can see how I:
- control the speed of the paperplane by pitching the phone
- steer the paperplane by rolling the phone,
- zoom in and out by pressing the left 'button' on the phone's touch screen
- change the camera mode to a random perspective by pressing the right 'button' on the touch screen
- change the camera perspective to the Third Person, First Person and default perspective by pressing the 1, 2 and 3 keyboard keys respectively.
The Papervision3D scene in the video stems from chapter 6 of the Papervision3D Essentials book.
Of course there are other apps than AIR that support UDP. For instance, I also managed to control a Unity file this way, so another video will follow soon.