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:
- Remotair Loves onBoard – Using samsung galaxy tab to remotely control system mouse using Remotair android app.
- Shumps with Remotair – Playing Shmups with Remotair http://wonderfl.net/c/dqyi using nexus one
- Live video transmitting from RC car – Live video transmmitting from an Android mounted on a RC-ed toy using #remotair
- Running Windows on Android using Remotair – Remote control of Windows via android device and #remotair
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
- JoystickEvent: JoystickEvent.CHANGE
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
- CameraEvent: CameraEvent.CAMERA_PUBLISHED
- CameraEvent: CameraEvent.CAMERA_UNPUBLISHED
- CameraEvent: CameraEvent.CAMERA_UPDATED
Microphone View
The main function of this view is to attachAudio over NetStream, that can be handled by Receiver.stream
- MicrophoneEvent: MicrophoneEvent.MICROPHONE_PUBLISHED
- MicrophoneEvent: MicrophoneEvent.MICROPHONE_UNPUBLISHED
- MicrophoneEvent: MicrophoneEvent.MICROPHONE_UPDATED
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:
wow, amazing! and thanks for sharing.
How was the Android app created? any chance we could see the source code?
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
No questions yet…. I will need to try on my own first. will ask if i get stuck.
P.S. great blog 🙂
Sounds great, i can’t wait the demo video 🙂
brad426, YopSolo thnx
demo video is ready, see it in article or on youtube http://www.youtube.com/watch?v=4Q-Gy9VP9gY
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….
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?
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!
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
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
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?
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!
@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 🙁
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)
It’s working now.
Thank you!
@parizer, cool to hear you made it work. I had to republished the remotair app into market this morning, should work fine now
[…] 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 […]
[…] 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 […]
Works perfectly fine on Nexus S. It’s going to become one of the must-have android apps, if it’s not yet.
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
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?
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 ?
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.
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.
hi Nicholas, try google “remotair apk”, androidzoom.com looks promising
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…
ok …sending via email
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?
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
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.
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
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)?
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
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.
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/
@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.)?
Adam, reciever is open sourced on https://github.com/jozefchutka/Remotair , transmitter sources (android app, playbook etc.) are not released open.
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
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 🙁
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)?
oscar, I have no info about plabook native remote controling pc or vice versa 🙁
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.
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
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).
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