Expand my Community achievements bar.

Basic Android + LCCS Webcam Setup Question

Avatar

Level 2

Hi All,

Sorry for the newbie question - I'm new to Flex, Android, and LCCS but am really impressed with what I've seen so far.  I have searched the forums to see if there was a similar question but as unable to find it.

I'm trying to get the LCCS WebCam working on the Android similar to the post on Christopher Coenraets blog:

http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/

All I want to do right now is authenticate and then have a ConnectSessionContainer.  I can get this to work inside of a WindowedApplication for Air for Desktop but not for Android.

For reference, I'm using Flash Builder Burrito and the Flash Player 9 SWC (which, as a side note, only works when I've also loaded in the path to src).

Right now, I have the main .mxml of my application (asdf_mobile.mxml") set with firstView = "asdf_mobileHome.mxml" in the s:mobileApplication tag.  I then put the authenticator in the fx:Declarations and the <rtc:ConnectSessionContainer> after that (outside of the declarations).

Here are the two files.

<?xml version="1.0" encoding="utf-8"?>
<s:MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:rtc="http://ns.adobe.com/rtc"
                          xmlns:mx="library://ns.adobe.com/flex/mx"
                          firstView = "views.asdf_mobileHome">
     <fx:Declarations>
          <!-- Place non-visual elements (e.g., services, value objects) here -->
     </fx:Declarations>
</s:MobileApplication>

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark" xmlns:rtc="http://ns.adobe.com/rtc">
     <fx:Declarations>
          <!-- Place non-visual elements (e.g., services, value objects) here -->
          <rtc:AdobeHSAuthenticator id="auth" userName="myusername" password="mypassword"/>
     </fx:Declarations>
     <rtc:ConnectSessionContainer authenticator="{auth}" roomURL="https://collaboration.adobelivecycle.com/myusername/myfirstroom" width="100%" height="100%">
     </rtc:ConnectSessionContainer>
</s:View>

Then in the asdf_mobile-app.xml, I've added in the camera:

     <manifest>

          <!-- See the Adobe AIR documentation for more information about setting Google Android permissions -->

          <uses-permission android:name="android.permission.INTERNET"/>
          <uses-permission android:name="android.permission.CAMERA"/>
     </manifest>

     </manifest>

Here are the errors I'm getting

Description     Resource     Path     Location     Type
1017: The definition of base class Canvas was not found.     asdf_mobile          line 106     Flex Problem

Description     Resource     Path     Location     Type
1020: Method marked override must override another method.     asdf_mobile          line 133     Flex Problem

This could be something really simple - like I don't understand where this ConnectSessionContainer is and is not allowed to go, or what it needs to be wrapped inside of.  I have created a few really basic mobile Android apps using getCamera(), and they've worked fine, but I can't figure out how to get the LCCS components to work.

Thanks in advance for any help.

Amit

21 Replies

Avatar

Employee

How did you configured your project ? For Spark only or mixed Spark and mx components ? Given that you only have the "s" and "fx" namespaces in your project I suspect it's spark only and that could be the problem since our "Flex" components relies on the old "mx" framework (and I think ConnectSessionContainer extends mx:Canvas).

I have a similar application where the project is configured for Spark only components and I use the flash-only LCCS sdk for player 9 (lccsFlash.swc). See the attached file (if it doesn't compile right away is because I removed a few extra stuff related to my project). It's a little more complex that our "standard" LCCS examples because it's using the "non visual components" (ConnectSession instead of ConnectSessionContainer, etc.) that need to be wired together.

Give it a try and see if that works for you. Also, you could try to create a new project configured for "mixed mode" (Spark + mx components) and you can try your example again. It may work but you'll be bringing the old Flex framework that is not optimized for mobile)

Avatar

Level 2

Hi Raff.,

Thanks so much for your help.  A few things I found:

1)  In Flash Builder Burrito, I only get the option for "mixed mode" (Spark + mx components) on Desktop Applications, not Mobile projects.

2)  Your code compiled perfectly with the FlashOnly SWC's but not with the full ones of any version.  Why is that?  There is an MX error for Label.

3)  Your code executes in the emulator on my screen but won't work on the Droid Pro I have connected to my computer for debugging.  Any idea how to make it work on the Droid Pro?

Thanks again!  This is very powerful I'm excited to get it up and running on a device and start building more from there.

Amit

Avatar

Employee

1) well, that means you can only use the flash-only SWCs we provide. All the others use the MX framework

2) see 1

3) what happen on the device ? My applicaiton works fine on a Nexus S (Android 2.3) and Galaxy Tab (Android 2.2). Do you have the AIR runtime installed on your Droid ? If you install a Flex application from the market it will tell you you need the AIR runtime. If you install via debugger it may not tell you anything.

Avatar

Level 2

Hi Raff.,

Thanks again for the response.

On #3, I do have Air installed on the Droid Pro.

What happens is that the application loads, I can see LCCS webcam at the top and the "End Call" button at the bottom.  But no webcam loads in the middle. For reference, it does work on the desktop emulator.

Also I have been able to get the SampleCameraCapture from the Tour De Flex to work on the Droid Pro - that was able to access the camera.  I believe it uses the CameraUI function.

Any ideas?

Thanks!

Amit

Avatar

Level 2

Hi Raff,

Sorry to bother - were the responses I gave able to tell you anything more?  Any ideas on what could be happening?

Thanks!

Amit

Avatar

Employee

Oops! Sorry, I forgot about you

The only other thing I can think of is that you forgot to enable the camera permission in the Android section of the manifest file (the application-app.xml thingy).

Make sure you have network and camera enabled:

                        <manifest android:installLocation="auto">

                                <uses-permission android:name="android.permission.INTERNET"/>

                                <uses-permission android:name="android.permission.CAMERA" />

                                   ....

                         </manifest>

Avatar

Level 2

No problem.

Awesome that's better!  Can't believe I forgot that - I had it in the other project.

I'm going to press my luck here.  The only thing is now the camera shows up, and I can video conference, but what it captures is this weird purple tinge.  It works fine on my desktop and that image shows up fine on the Droid Pro, just what it's capturing is purple.  This doesn't happen when I run the SampleCameraApplication.

Any ideas?  Image attached below.

purpledesk.jpg

Avatar

Level 2

Hi Raff!

Sorry to be a bother - did you have a chance to take a look at my last question?  I've been trying a lot of things but haven't been able to figure it out.   That's the final thing, and I should be good to go!  It's working great aside from the odd color tone.

Thanks!

Amit

Avatar

Employee

Sorry, it doesn't happen to me (but again I don't have a Droid Pro) and I really have no clues unless you somehow are overlaying something on top of your camera.

Can you share your code ?

Avatar

Level 2

Hi Raff,

Here's the fxp file for the project.

http://rapidshare.com/files/456516658/asdf_mobile3.fxp

All I changed were the username and password and the account name.

Sorry about the temp project name.  Also I couldn't find a way to upload directly onto here so I used rapidshare.  I could post each of the three files if you prefer.

Anything seem off?

Thanks!

Amit

Avatar

Employee

I tested your app and it works fine for me. But I am testing with the pre-release FlashBuilder 4.5 / AIR 2.6 while your app I think is written for the MAX version of FlashBuilder (old manifest and s:MobileApplication tag). I am wondering if that version of AIR had some bugs in the camera code.

Any chance you can try updating to the prerelease builds ?

Avatar

Level 2

Hi Raff,

I checked to see if I have the latest build.  I'm using Adobe Flash Builder Burrito and my Droid Pro is running Air 2.6.

Is there anything newer than Burrito I need to download?  By default, it created the manifest and s:MobileApplication tag.

Thanks again for all the help - any guidance would be great.

Avatar

Employee

It would be helpful to know the build number (but I bet it's NOT the latest build, because <s:MobileApplication> has been removed / renamed to <s:ViewNavigatorApplication>, you can read about it here: http://devgirl.org/2011/04/11/flash-builder-4-5-mobile-highlights/)

Again, I am not sure that this is your problem. All I am saying is that the initial version distributed at MAX (and that I guess is what is available at labs.adobe.com) was very preliminary and camera support may have been less that perfect).

The version I am using (currently build 4.5.304901) is from the prerelease program, that is what is being updated with the latest fixes (but I suspect that since the commercial release has been announced, the prerelease program is now closed)

Avatar

Level 2

Hi Raff.,

In my Installation Details, it says:

Adobe Flash Builder Localized Top Feature: Version 4.5.0.287807 - is that the build number you're referring to?

Also, I got my hands on a Samsung Galaxy Tab to test, which you mentioned you got your code to work on.  I'm curious whether it's the code / build or the Droid Pro itself.

Unfortunately, I'm having a bit of a problem getting the Galaxy Tab setup to work with Flash Builder (can't seem to get it in Debug Mode).  There is an unsolved thread on the Adobe Forums here:

http://forums.adobe.com/message/3618231#3618231

If you got the Galaxy Tab working - do you think you could lend some help there as well?  I'll then post the results of whether this code works for me on the Tab.

Thanks!

Amit

Avatar

Employee

If I remember well that version of FlashBuilder doesn't have the USB drivers for the Galaxy Tab (or any other Galaxy).

There are two ways to get the drivers:

1) Install the latest version of the Android SDK (a bit of an overkill but you'll be able to check that you can put the Galaxy Tab in debug mode)

2) Install the Samsung USB drivers (I remember doing a search of Google regarding GalaxyTab and debugging and USB drivers and got a link to the Samsung site). Basically you need the standard drivers that allows you to connect the tablet to your computer (for downloading pictures and stuff).

I don't remember if there was a "secret way" to enable the "enabled debugging" option on the tablet (again, Google is your friend), but the first thing I suggest is to get the correct drivers and verify that you can install an Android app from your computer to the tabled. Once that is done, FlashBuilder should recognize the device.

Avatar

Level 2

Got it working!

For reference, it works on the Galaxy Tab, but the Droid Pro is still doing that weird purple thing.  It must be phone-specific.

In the above thread on the Galaxy Tab, someone has posted links to the drivers, and those worked for me.  I had to uninstall the existing drivers and make sure to delete them and restart first.

I'm marking this as answered but will try to push my luck a little bit.  Raff - do you know how to access the front-facing camera instead of the back one on the Tab?

Thanks!

Amit

Avatar

Employee

Funny you should ask

The front-facing camera is not supported in Android 2.2 (and manufacturer have their "special" ways" to access it in their apps).

Android 2.3 added support for the front-facing camera but AIR mobile doesn't support it yet. It's in the works and it should come in the next major version of AIR.

Currently only iOS has support for the front facing camera, so if you have an iPhone you can test and debug your app there while waiting for Android support.

Avatar

Level 1

Hi Raff,

I tried your code on the Galaxy Tab... it launches, but all I see is a blank white screen. It does the same thing with the emulator. Any suggestions?

Thanks,

Michael

Avatar

Level 2

i get

INVALID_INSTANCE: Invalid Instance

at com.adobe.rtc.session.managers::SessionManagerBase/receiveError()[/Users/hbrlabs/Documents/Adobe Flash Builder Burrito Preview/asdf_mobile3/linked-src/src/com/adobe/rtc/session/managers/SessionManagerBase.as:355]

at com.adobe.rtc.session.managers::SessionManagerFMS/receiveError()[/Users/hbrlabs/Documents/Adobe Flash Builder Burrito Preview/asdf_mobile3/linked-src/src/com/adobe/rtc/session/managers/SessionManagerFMS.as:323]

at com.adobe.rtc.session.managers::SessionManagerAdobeHostedServices/receiveError()[/Users/hbrlabs/Documents/Adobe Flash Builder Burrito Preview/asdf_mobile3/linked-src/src/com/adobe/rtc/session/managers/SessionManagerAdobeHostedServices.as:284]

at com.adobe.rtc.session.managers::SessionManagerAdobeHostedServices/onMeetingError()[/Users/hbrlabs/Documents/Adobe Flash Builder Burrito Preview/asdf_mobile3/linked-src/src/com/adobe/rtc/session/managers/SessionManagerAdobeHostedServices.as:111]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.adobe.rtc.session.sessionClasses::MeetingInfoService/onError()[/Users/hbrlabs/Documents/Adobe Flash Builder Burrito Preview/asdf_mobile3/linked-src/src/com/adobe/rtc/session/sessionClasses/MeetingInfoService.as:463]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()

Avatar

Level 1

Hi All,

I have similar problem on galaxy s2 phone and I have already opened a defect for that. Please take a look at this https://bugbase.adobe.com/index.cfm?event=bug&id=2901011

I guess that adobe air camera is not working properly with limited set of devices. Anybody knows any workaround how to fix purple color tone ?

Thanks