This post is a follow up to my session at Adobe Flash Platform Summit 2011, Bangalore on the 28th of July. I spoke on Peer to Peer for Mobile Devices with the Flash Platform. Peer to Peer has been around for a long time now, but its not often you see apps making use of this immensely capable technology. My talk covered the possibilities that could come to life with P2P on Mobile, along with some demo’s. Here is the Slide Deck,
As part of my demo at AFPS, I wrote the RealTime Locator, a simple app that shares its location with every peer in a group over the RTMFP protocol. Basically, I do a Lat/Long multicast on receiving the coordinates via GPS. The other interesting aspect is the same app, with ZERO code change is deployed on 3 different platforms, Android, Blackberry Playbook, and the iOS.
Here is a video showing the app running on the three devices, HTC Desire HD, Blackberry Playbook, and an iPod Touch,
I made use of the freely available non-commercial service, Adobe Cirrus, for initiating P2P connections, and the awesome MapQuest Flex library for displaying and plotting location on the map. The GPS location is represented in Red, and the shared locations in Green.
The FXP has been online for a while now, and here is the link again,
Here is what you need to modify to get it working,
• Views/MapView.mxml – Replace the value for ‘MAP_KEY’ with your MapQuest API key. Get your key at, http://developer.mapquest.com/
• Controller/p2p.as – Replace the value for ‘DEVELOPER_KEY’ with your Cirrus Key. Register for a Cirrus Key here, http://labs.adobe.com/technologies/cirrus/
NOTE : To facilitate P2P connections over the LAN only, replace the value for ‘SERVER_ADDRESS’ with ‘rtmfp://’ and leave the value for ‘DEVELOPER_KEY’ blank (‘ ’). Optionally also edit the P2P Group Name.
This application only demonstrates one of the capabilities of P2P with Flex. Feel free to get the code and build on it for greater possibilities.
Download Android Installer (.APK)
The above app uses a different P2P Group than what is seen in the shared FXP file. The two will not work in conjunction.
*The Blackberry and iOS apps are not hosted due to licencing and distribution constraints. Feel free to download the source and deploy on the two devices.