Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Trusted Contributor
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha
My Carrier: -
Accepted Solution

Launching/Capturing Camera on BB10

Hi,

 

I want to know if I can launch the Camera from my Adobe AIR application on BB10 device.

 

Can anyone point me to some code which does the following:

  • Launch the front/rear camera.
  • Add listeners to check for Image captured/canceld operation.
  • Get the refernce to saved image OR get the bitmap of the captured image.

Thanks!

Developer
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: Launching/Capturing Camera on BB10

Look at jtegen's code sample in this thread - haven't tried it myself yet, but his stuff usually works :-)

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/How-to-Open-Camera-in-playbook/td-p/204...

(the thread title refers to PlayBook, but the code should actually work in BB10)

 

Anna

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Trusted Contributor
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha
My Carrier: -

Re: Launching/Capturing Camera on BB10

I tried but this code is not working on device!

 

I was able to compile the code, but when I click on button, which invokes camera, nothing happens. Has anyone used camera in their BB10 air app? Sample code will greatly help.

 

Thanks!

Developer
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: Launching/Capturing Camera on BB10

[ Edited ]

I can't try it out, because on my device the camera isn't working in the first place, but here are a couple of things:

 

Try changing this line:

request.data.writeUTF( 'photo' );

 to:

 

request.data.writeUTFBytes( 'photo' );

 

If that doesn't fix it, check out the recently updated documentation, maybe something has changed:

https://developer.blackberry.com/air/documentation/bb10/camera.html

 

Hopefully RIM will add some examples to those pages ....

 

<edit>

I just corrected the code above according to jtegen's observent comment below, so the extra dot is gone - just to avoid confusion

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Launching/Capturing Camera on BB10

Note: no double dots before writeUTFBytes. One is fine.
Developer
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: Launching/Capturing Camera on BB10

oops! yes, thanks John!

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Trusted Contributor
Posts: 101
Registered: ‎03-04-2011
My Device: BB10-Dev Alpha
My Carrier: -

Re: Launching/Capturing Camera on BB10

This is also not working :-(

 

Even documentation does not have any sample to check.