Video Chat for Android in 30 Lines of Code

Here is a simple Video Chat application I built with Flex 4 and deployed on AIR for Android. The Application is just 30 lines of code and allows multiple users to join a chat room and “video chat”.

Video streaming is powered by LiveCycle Collaboration Services, a set of hosted Flash Services that enable developers to easily add real-time collaboration and social capabilities to their applications.

This application is obviously a bare-bones proof of concept. However, it is fully operational, and the same code can run on different runtime environments: AIR for Android, AIR on the Desktop, and Flash Player in the Browser. Users can participate in the same collaboration session regardless of the runtime environment they use.

Watch the video:

The 30 lines of code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:cs="AfcsNameSpace" currentState="logon" fontSize="28">

	<fx:Script>
		[Bindable] private var roomURL:String = "http://connectnow.acrobat.com/YOUR_ROOM_NAME";

		protected function connect():void {
			auth.userName = userName.text;
			currentState = "default";
			session.login();
		}
	</fx:Script>

	<s:states>
		<s:State name="default"/>
		<s:State name="logon"/>
	</s:states>

	<fx:Declarations>
		<cs:AdobeHSAuthenticator id="auth"/>
	</fx:Declarations>

	<s:TextInput id="userName" includeIn="logon" top="200" horizontalCenter="0"/>
	<s:Button label="Connect" click="connect()" includeIn="logon" top="250" horizontalCenter="0" height="50" width="150"/>

	<cs:ConnectSessionContainer id="session" roomURL="{roomURL}" authenticator="{auth}" autoLogin="false" width="100%" height="100%" includeIn="default">
		<cs:WebCamera top="10" left="10" bottom="10" right="10"/>
	</cs:ConnectSessionContainer>

</s:Application>

Comments

  1. Nice!!!

  2. Alex Yule says:

    Super cool!

  3. Lee says:

    30 lines of configuration does not add up to 30 lines of code.

    All the heavy lifting is done by AIR and LiveCycle.

  4. RBL says:

    Well done! Facetime for Android.

  5. Ji says:

    Thank you for sharing this great tutorial! this is fantastic!

  6. warez says:

    Good stuff.Thank you!

  7. Tahir Alvi says:

    Hi,
    You do an excellent job.

    But i try to run this code in Desktop but it has following line errors

    Where we get this refrence classes.

    Thanks

  8. video chat goot

  9. Well done! Facetime for Android.
    Carton Machine

  10. Well done! Super.. Thanks…

  11. Thank you for sharing this great tutorial…

  12. Binu Mathew says:

    I am getting error on line no 20 and 26 i am using Flash Builder 4,
    This is the error showing
    Could not resolve to a component implementation
    Could not resolve to a component implementation

    what is the problem?

  13. Joe Trnka says:

    Hey I am so glad I found your web site, I really found you by mistake, while I was researching on Bing for something else, Regardless I am here now and would just like to say thanks for a fantastic post and a all round entertaining blog (I also love the theme/design), I don’t have time to read through it all at the minute but I have saved it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the awesome work.

  14. Mike says:

    This is not working for me. Do you have more detailed instructions?

  15. ahsan says:

    what is this xmlns:cs=”AfcsNameSpace”?

  16. madhu says:

    Hi ,
    I am trying to develop the video chat application. Where I have to include the above xml(script). And how to start the application coding.

  17. Before moving with PODS Ripoffreport.com them

  18. Good article. Thanx…

  19. I noticed that the bounce rate on my web sites is pretty high – for most visits it is 100%. I believe my content is relevant to the search phrases I am discovered for. What do you believe may be the issue?. What exactly is a normal bounce rate for you?! Help !

  20. nhowdo says:

    just 30 lines, very nice

  21. Deepika says:

    what are all the requirements and how exactly to run this code??

  22. Deepika says:

    what are the requirements and how exactly to run this code??

  23. Hello Christophe,

    I run the code in flash bulder 4.5.1 with lccs.swc SDK in android mobile application project and I got this compilation error :

    “ConnectSessionContainer’ declaration must be contained within the tag, since it is not assignable to the default property’s element type ‘mx.core.IVisualElement’ “.

    Thank’s for your help
    Royi.

  24. James Mew says:

    Does anybody have a flash 4.5.1 project that they would share

  25. Thank you for useful information. Waiting for new posts.

  26. Sgar misal says:

    But how to run this code on eclipse gelileo for Android Apllication

  27. Nice feature, thanks for sharing!

  28. Comfy_ro says:

    Thank you for sharing. Really nice!

  29. Comfy_ro says:

    Thanks for sharing. Nice post!

  30. rajan says:

    I have used the code for conferencing. I have created my room in sdk and given proper authentication.
    My app is running without errors . But when i try to connect , all i can see is a blank window

    Could you please help me to sort out this issue

  31. Nue says:

    Excuse me. I have some question to aks to you that how can I run this app.Because I don’t understand about Flex

Trackbacks

  1. [...] An interesting post from Adobe evangelist, Christophe Coenraets, where he creates a video chat application for Android in just 30 lines of configuration code, leveraging Adobe LiveCycle Collaboration Service. Grab the code and read more on his blog here. [...]

  2. [...] Video Chat for Android in 30 Lines of Code [...]

  3. Webfavorites says:

    Supercooled water | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  4. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  5. [...] man eine in Aktion zu sehen. Welches ist, warum Adobe Technical Evangelist Christophe Coenraets hat zusammen eine Demo zeigen, was AIR tun können, wenn es genutzt wird, um die gleiche Anwendung auf beiden [...]

  6. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  7. [...] bad it’s only a proof-of-concept.. for [...]

  8. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  9. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  10. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  11. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  12. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  13. sarkem.org says:

    Executive netbook – the beginning…

    I found your entry interesting thus I’ve added a Trackback to it on my weblog :)

  14. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  15. Siskatec says:

    fVisiOn NTIC te hace ver conejos no significativas…

    I found your entry interesting thus I’ve added a Trackback to it on my weblog :)

  16. Webfavorites says:

    How to fold | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  17. Webfavorites says:

    How to fold | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  18. [...] [Source] Loading google.load('search', '1'); google.setOnLoadCallback(function(){ new google.search.CustomSearchControl('012240321471511227919:cz4ngqat5fa').draw('cse'); }, true); [...]

  19. Webfavorites says:

    Amazing ping pong skills | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  20. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  21. Webfavorites says:

    When Flash goes bad | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  22. Webfavorites says:

    Funny commertial | video…

    I found your entry interesting, and I’ve added a Trackback to it on my weblog :) Thank You!…

  23. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  24. Bipolar Darkness Chapter 1 by youtube poster vigilante114…

    I found your entry interesting thus I’ve added a Trackback to it on my weblog :)

  25. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  26. [...] bad it’s only a proof-of-concept.. for now. Tweet ThisSHARETHIS.addEntry({ title: "Video: Flash-based video conferencing for [...]

  27. [...] Video chat for Android using LiveCycle Collaboration Service and AIR [...]

  28. [...] •        AIR2.5 StageWebView演示 •        AIR里的地理定位 •        关于使用LiveCycle Collaboration Service和AIR的Android的视频图表 •        使用P2P连接桌面apps的Android apps:这儿和这儿 •        [...]

  29. [...]       AIR2.5 StageWebView演示 •        AIR里的地理定位•        关于使用LiveCycle Collaboration Service和AIR的Android的视频图表•        使用P2P连接桌面apps的Android apps:这儿和这儿•      [...]

  30. [...] when you can see one in action. Which is why Adobe Technical Evangelist Christophe Coenraets has put together a demo showing off what AIR can do when it’s used to deploy the same application across both [...]

  31. [...] is just another example of “built-in” collaboration (go here and here for more). The point is really how easy it is to add these collaboration features to any [...]

  32. [...] des applications collaboratives basées sur LCCS (LiveCycle Collaboration Service). Après la vidéo-conférence et le morpion, un peu de cartographie cette [...]

  33. [...] is just another example of “built-in” collaboration (go here and here for more). The point is really how easy it is to add these collaboration features to any [...]

  34. [...] Video Chat for Android in 30 Lines of Code — 30 lines of code and you can do multi-user video chat!   Takes advantage of Adobe LiveCycle Collaboration Services [...]

Speak Your Mind

*