Remotair

Remotair is a concept of transmitting device input events (gestures, accelerometer, camera etc.) into receiving flash or AIR application. Remotair consists of one transmitting application installed on a mobile device or a tablet and one receiving application running on a PC. In order to pair transmitting and receiving application, RTMFP protocol is used. The receiver API is public and released under MIT license.

You can download Remotair application from Android market (link only works on android devices) or see the Android application details on AppBrain. For a receiving application you may use the demo application located on remotair.yoz.sk or you can build your own one using Remotair Receiver API.

What is remotair capable of?

The current version of Remotair transmitter is available for Android devices and is capable of transmit touch events and gestures, keyboard events (using native keyboard or custom buttons), accelerometer, geolocation/GPS microphone and camera. Accelerometer, geolocation, microphone and camera can be transmitted in background mode, that means user can interact with touch or keys while mentioned sensors/inputs are being transmitted at the same time (e.g. accelerometer + camera + gestures).

How can I use it?

For now, to see what is Remotair all about, install transmitter application to your Android device and click connect. Once you get the channel number, run receiver demo. Now those two apps connects via P2P. Once they are connected, you can start clicking different views in transmitter and see the log or custom event handling view on receiver side.

Demo video featuring Keyboard, Mouse, Touch, Gesture, Accelerometer, Geolocation, Camera, Microphone:

Imagine you have a RC model of a car or a helicopter, you can mount your mobile device onto it, turn transmitting camera and microphone on and you are ready to controll the model while sitting before PC see and hear everything. Or, you build and cutting edge flash game that can be controlled by accelerometer and joysticks etc.

Remotair Receiver API

All the necessary classes can be downloaded from github and classes.yoz.sk. Check out the demo application built over the api on remotair.yoz.sk. The basic application may look something like this:

import flash.events.AccelerometerEvent;
import sk.yoz.remotair.events.GenericConnectorEvent;
import sk.yoz.remotair.net.GenericConnector;
import sk.yoz.remotair.net.Receiver;

private var receiver:Receiver = new Receiver(
	GenericConnector.HANDSHAKE_URL, 
	GenericConnector.DEVELOPER_KEY, 
	GenericConnector.CHANNEL_SERVICE);

private function connect(channel:String):void // channel = 1234 etc.
{
	receiver.connectChannel(channel);
	receiver.addEventListener(GenericConnectorEvent.PEER_CONNECTED, onPeerConneceted);
	receiver.accelerometerEvents.addEventListener(AccelerometerEvent.UPDATE, onAccelerometerUpdate);
}

private function onPeerConneceted(event:GenericConnectorEvent):void
{
	// transmitting application on your device is now connected with this app
}

private function onAccelerometerUpdate(event:AccelerometerEvent):void
{
	trace(event.accelerationX, event.accelerationY);
}

Transmitter

Here is a list of events dispatched with each view on transmitter. The most of those are native ActionScript events, plus some custom:

Keyboard View

  • TextEvent: TextEvent.TEXT_INPUT
  • TextEvent: RemotairEvent.TEXT_CHANGE
  • KeyboardEvent: KeyboardEvent.KEY_DOWN
  • KeyboardEvent: KeyboardEvent.KEY_UP

Numbers and Arrows View

  • KeyboardEvent: KeyboardEvent.KEY_DOWN
  • KeyboardEvent: KeyboardEvent.KEY_UP

Gamepad View

  • KeyboardEvent: KeyboardEvent.KEY_DOWN
  • KeyboardEvent: KeyboardEvent.KEY_UP
  • JoystickEvent: JoystickEvent.CHANGE

Mouse View

  • MouseEvent: MouseEvent.MOUSE_DOWN
  • MouseEvent: MouseEvent.MOUSE_MOVE
  • MouseEvent: MouseEvent.MOUSE_UP
  • MouseEvent: MouseEvent.CLICK
  • MouseEvent: RemotairEvent.MOUSE_LEFT_DOWN
  • MouseEvent: RemotairEvent.MOUSE_LEFT_UP
  • MouseEvent: RemotairEvent.MOUSE_LEFT_CLICK
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_DOWN
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_UP
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_CLICK

Touch View

  • TouchEvent: TouchEvent.TOUCH_BEGIN
  • TouchEvent: TouchEvent.TOUCH_END
  • TouchEvent: TouchEvent.TOUCH_MOVE
  • TouchEvent: TouchEvent.TOUCH_OUT
  • TouchEvent: TouchEvent.TOUCH_OVER
  • TouchEvent: TouchEvent.TOUCH_ROLL_OUT
  • TouchEvent: TouchEvent.TOUCH_ROLL_OVER
  • TouchEvent: TouchEvent.TOUCH_TAP

Gestures View

  • GestureEvent: GestureEvent.GESTURE_TWO_FINGER_TAP
  • PressAndTapGestureEvent: PressAndTapGestureEvent.GESTURE_PRESS_AND_TAP
  • TransformGestureEvent: GestureEvent.GESTURE_PAN
  • TransformGestureEvent: TransformGestureEvent.GESTURE_ROTATE
  • TransformGestureEvent: TransformGestureEvent.GESTURE_SWIPE
  • TransformGestureEvent: TransformGestureEvent.GESTURE_ZOOM

Joystick View

Remote Desktop View

When view initialized, RemotairEvent.INIT_REMOTE_DESKTOP is sent with data containing widht and height of the device screen and channel name to be created.

  • RemotairEvent: RemotairEvent.INIT_REMOTE_DESKTOP
  • MouseEvent: MouseEvent.MOUSE_DOWN
  • MouseEvent: MouseEvent.MOUSE_MOVE
  • MouseEvent: MouseEvent.MOUSE_UP
  • MouseEvent: MouseEvent.CLICK
  • MouseEvent: RemotairEvent.MOUSE_LEFT_DOWN
  • MouseEvent: RemotairEvent.MOUSE_LEFT_UP
  • MouseEvent: RemotairEvent.MOUSE_LEFT_CLICK
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_DOWN
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_UP
  • MouseEvent: RemotairEvent.MOUSE_RIGHT_CLICK
  • KeyboardEvent: KeyboardEvent.KEY_UP

Accelerometer View

  • AccelerometerEvent: AccelerometerEvent.UPDATE
  • StatusEvent: StatusEvent.STATUS

Camera View

The main function of this view is to attachCamera over NetStream, that can be handled by Receiver.stream

Microphone View

The main function of this view is to attachAudio over NetStream, that can be handled by Receiver.stream

Geolocation View

  • GeolocationEvent: GeolocationEvent.UPDATE
  • StatusEvent: StatusEvent.STATUS

Receiver

Transmitted events are dispatched into Receiver class. You may notice there are some custom events, that should be selfexplanatory by code or once debuged.

  • Receiver.remotairEvents: RemotairEvent
  • Receiver.viewEvents: ViewEvent
  • Receiver.mouseEvents: MouseEvent
  • Receiver.keyboardEvents: KeyboardEvent
  • Receiver.textEvents: TextEvent
  • Receiver.joystickEvents: JoystickEvent
  • Receiver.cameraEvents: CameraEvent
  • Receiver.microphoneEvents: MicrophoneEvent
  • Receiver.activityEvents: ActivityEvent
  • Receiver.statusEvents: StatusEvent
  • Receiver.accelerometerEvents: AccelerometerEvent
  • Receiver.touchEvents: TouchEvent
  • Receiver.gestureEvents: PressAndTapGestureEvent, TransformGestureEvent, GestureEvent
  • Receiver.geolocationEvents: GeolocationEvent

More reading:

45 comments so far

  1. brad426 December 16, 2010 21:02

    wow, amazing! and thanks for sharing.
    How was the Android app created? any chance we could see the source code?

  2. Jozef Chúťka December 17, 2010 12:15

    brad426, sorry I am not willing to open the android source for now. but I can answer you any questions you have about it. feel free to ask

  3. brad426 December 17, 2010 22:36

    No questions yet…. I will need to try on my own first. will ask if i get stuck.
    P.S. great blog :)

  4. YopSolo December 18, 2010 09:45

    Sounds great, i can’t wait the demo video :)

  5. Jozef Chúťka December 20, 2010 13:28

    brad426, YopSolo thnx
    demo video is ready, see it in article or on youtube http://www.youtube.com/watch?v=4Q-Gy9VP9gY

  6. brad426 December 21, 2010 22:10

    very cool demo. I have been messing around with the android transmitter app for the last few days ( using your android app to connect to my swf :( ) interesting times ahead….

  7. Jozef Chúťka December 22, 2010 11:10

    brad426, feel free to drop here some feedback, I am willing to make the api understandable as much as possible… so – does it work for you? any issues?

  8. brad426 December 22, 2010 19:59

    Yeah, everything works great. I haven’t picked up on any issues/bugs. To be honest, I haven’t looked too deep into the api ( like how GenericConnector actually works), but using it is very easy. You did a great job!

  9. Jozef Chúťka December 23, 2010 14:22

    Cool, I like to hear that. I have uploaded crossdomain file for channel service domain, so it works now for third party .swf files… + check out gamepad view in version 0.1.5

  10. parizer January 12, 2011 04:51

    Hi Jozef,

    great app. I have Samsung Galaxy S (2.2.1 I9000XXYJY)and camera doesn’t work.
    Everything else works great. Do I need to change some android setting?
    Thanks

  11. Jozef Chúťka January 12, 2011 12:27

    Hi parizer,
    what exactly does it mean it does not work?
    – is camera button disabled?
    – does it show a page with camera settings?
    – can you see something in camera preciew?
    – is there a problem with transmitting it into receiving application?

  12. parizer January 12, 2011 16:11

    Hi Jozef,

    This is all I get:
    http://www.picupload.us/?v=remotairandroid.png
    http://www.picupload.us/?v=remotairpc.jpg
    I tried to create AIR file, and camera doesn’t work if I am using Camera.getCamera() and with CameraUI() it works OK. So problem (bug) is in my Galaxy S?
    btw. your app is awesome!

  13. Jozef Chúťka January 12, 2011 16:53

    @parizer, thank you for your feedback and for noticing the issue. I guess that must be some Galaxy S specific thing. I am not sure how to make it work for now, maybe with next air version or android version, it gets fixed itself … I believe with CameraUI you can only catch already saved image/video not live streaming :(

  14. parizer January 13, 2011 05:13

    Hard reset fixed problem and now camera works ok (getCamera() etc…)
    Hard reset deleted all my installed apps, and now I can’t find Remotair on Market.
    Error info: “Not found. The requested item could not be found.”
    It’s listed on AppBrain but not on Android Market (btw. I am from Croatia)

  15. parizer January 13, 2011 10:37

    It’s working now.
    Thank you!

  16. Jozef Chúťka January 13, 2011 10:46

    @parizer, cool to hear you made it work. I had to republished the remotair app into market this morning, should work fine now

  17. [...] been wanting to play with ever since checking out Jozef Chúťka’s (aka @jozefchutka) Remotair application. In fact, I could have built this thing using Remotair, but I wanted to get my hands dirty with a [...]

  18. [...] desktop app you have downloaded is just a demo, you can use Remotair api to build your own desktop application and to include your own [...]

  19. Glav May 1, 2011 01:17

    Works perfectly fine on Nexus S. It’s going to become one of the must-have android apps, if it’s not yet.

  20. webfraggle May 5, 2011 21:05

    Hi Jozef

    Do you think it is possible to get the Remotair Application on the iPhone?

    Have you developed it using AS3 or native Android Code?

    Thanks
    webfraggle

  21. Jozef Chúťka May 6, 2011 09:21

    Hi webfraggle,
    it is developed using AS3, so there is almost no problem porting it to iPhone/iPad … only one issue – I am not iOS developer, not having account and all the stuff. would you like to use it with your iphone?

  22. Glav September 28, 2011 15:07

    Hum. Sending everything to a web page in Slovakia to get the data back in your living room makes everything quite slow. Is it possible to have a local mode, like a Lighttpd server on the PC-side and you connect to 192.168.some.thing on the android device ?

  23. Jozef Chúťka September 29, 2011 10:28

    Hi Glav,
    do not get confused here. onlything that goes through my gateway is a simple handshake – translates your number 1234 into something than can be used for connecting peered device. Besides that flash always runs on client and RTMFP is smart enough to find the shortest roundtrip through the network to use just your home router if possible.

  24. nicholas_rom November 21, 2011 12:26

    Is there a chance to get the Remotair.apk ?
    by download it directly from a link or my e-mail;
    cannot access the Android Market…

    Many Thx.

  25. Jozef Chúťka November 21, 2011 13:11

    hi Nicholas, try google “remotair apk”, androidzoom.com looks promising

  26. nicholas_rom November 21, 2011 17:12

    did that and received an e-mail with a link which seems that be invalid one:
    “There are no matches in Android Market for: ‘pname:air.sk.yoz.remotair’

    It seems that there is no chance to get that *.apk file be downloaded
    directlly on my computer and from there to install it in my Android device…

  27. Jozef Chúťka November 21, 2011 21:12

    ok …sending via email

  28. trix December 28, 2011 18:47

    I have been reading alot about the app and everything seems promising, but I don’t understand if it works by sending any information online to any specific location as a P2P program?

  29. Jozef Chúťka December 29, 2011 11:04

    hi trix, remotair uses native rtmfp (p2p) protocol available in flash player. the current implementation in remotair rquires your devices (e.g. pc+smartphone) to be connected to internet for a handshake, then after devices are paired I believe shortest possible path/circuit is used for communication

  30. donnell January 12, 2012 22:13

    dude, this does not work on playbook can you help me, i am not yet a developer so i dont know what you guys are takling about so forgive me , but i am excited to see how your app works.

  31. Jozef Chúťka January 13, 2012 14:26

    hi Donnell,
    this application is primarily for devs, anyway you can see how it works on videos on http://remotair.yoz.sk/ … if you can not connect, please read the comment above your one http://blog.yoz.sk/2010/12/remotair/comment-page-1/#comment-4877

  32. Adam G March 19, 2012 03:21

    Like some of the commenters above, I would like to work without an internet connection required. Would it be possible to do the handshake locally, or use a direct connection to the device (or desktop)?

  33. Jozef Chúťka March 19, 2012 10:20

    Adam, sorry currently the possibility to to pair devices without being online is not implemented, however flash player has the capabilites of doing it (using local router). Unfortunately I have no time to do more development on remotair for now

  34. Adam G March 19, 2012 15:49

    Ok, but is it possible to do a direct connection (via IP)? If you had an idea on how to do it, I’d love to know as I’m probably going to have to do that anyway.

  35. Jozef Chúťka March 19, 2012 18:05

    Adam, I believe its not possible to direct connect over rtmfp, it is possible to connect using lan (local router), read more on http://www.flashrealtime.com/local-flash-peer-to-peer-communication-over-lan-without-cirrus/

  36. Adam G March 19, 2012 21:13

    @Jozef

    Cool. That was exactly what I wanted. Have you published the source for either the PlayBook or Android client of Remotair (I would really like to see the PlayBook code.)?

  37. Jozef Chúťka March 20, 2012 13:11

    Adam, reciever is open sourced on https://github.com/jozefchutka/Remotair , transmitter sources (android app, playbook etc.) are not released open.

  38. oscar March 31, 2012 22:58

    I have spent 2 months trying to find a multicast P2P app for Playbook where the objective is to livestream the screen of one Playbook to the other Playbooks in order to show a Power Point presentation. You might have the answer. A medical doctor developed such an app for iPads http://itunes.apple.com/us/app/conference-pad/id377782792?mt=8 it is very simplistic without being simple! Seems to connect Bluetooth, WiFi, etc. I have tried DLNA, VLC, HTML5 and finally Adobe Air when I came across your products. Can you change OnStream to stream the screen contents instead of the cameras? Is the catch that each unit have to handshake via your FMS so it won’t work on a LAN not connected to the internet? Very good work you do and pleasure to get to know your work. Oscar

  39. Jozef Chúťka April 1, 2012 11:38

    hi oscar,
    unfortunately, flash/air has native api for streaming webcams only not the desktop screen. I am not saying its not doable through an air application however it would require some os specific native extensions. For windows there are some utils that can stream your screen into a virtual webcam that you can stream via onStream, if you find something like this for android you can get closer. onStream as well as Remotair use rtmfp that use cirrus server for a handshake. Even there is api to handshake and communicate via local router, due to lack of time I am currently not planning to implement it into my apps :(

  40. oscar April 1, 2012 17:55

    Hi Jozef, thanks for quick answer. I have now compiled an app that does native P2P screen live streaming on my local LAN without FMS thanks to your useful links above. A last question, has RIM blocked access to the screen/graphicscard for Playbook (I have noticed there is no RemoteDesk app for remote controlling Playbook)?

  41. Jozef Chúťka April 3, 2012 12:48

    oscar, I have no info about plabook native remote controling pc or vice versa :(

  42. Denis March 23, 2013 15:24

    Hi, Jozef.

    The project is realy great!
    I’ve been so impressed!

    My question.
    If we talk about RTMFP, why we should pair android device and pc viewer?
    Can we see the viceo from one android camera on a few viewers simultaneously?

    Thank you.

  43. Jozef Chúťka March 23, 2013 16:02

    hi Denis,
    in general, using rtmfp you can share your camera with any number of viewers you want. Remotair implementation expects 1 sender and 1 transmitter only… The down side of streaming to multiple receivers may be the upload traffic from the sender, as he streams the video p2p to everyone, or have a look at NetGroup to get advantage of some more advanced p2p stuff

  44. Denis March 23, 2013 17:50

    Thank you Josef for a quick reaction.

    I am not deep in all this (for example, I do not understand, what does it mean “have a look at NetGroup” :)
    But I think, the most one advantage of RTMFP vs RTMP is posibility to sent video to multiple recievers without increasing camera’s net chanel load.
    I thought, I can see this in Remotair, as it declared to use rtmfp, but the it’s implementation expects 1 to 1.

    Would you advise me any (opensource would be perfect)project, where I could see a 1 to N broadcasting via RTMFP (not using cyrus).

  45. Jozef Chúťka March 25, 2013 11:46

    Denis, I think adobe provides nice and simple api for p2p stuff. There are also some frameworks around it like https://sites.google.com/site/hydrap2p/ , but if you are flash developer, the native api in flash/air is sufficient to do such an app. If you do not want to use cirrus, you can use own redevous server or you can do even without one – when creating p2p groups within LAN

Leave a comment

Please be polite and on topic. Your e-mail will never be published.