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

Web and WebWorks Development

Reply
Contributor
Posts: 15
Registered: ‎05-19-2011
My Device: Storm2 9550
My Carrier: Student
Accepted Solution

About new Camera's API

Hi, I'm trying to make a button for my application that shoots the camera.. 

 

I'm using the new API, which is included in the version 2.1 of the SDK..

 

I'm working with an example that I found in this forum


 

 

 

 

 

 

 

function takePicture() {
  try {
    blackberry.media.camera.takePicture(successCB, closedCB, errorCB);
  } catch(e) {
    alert("Error in supported: " + e);
  }
}

function successCB(filePath) {
  alert("Succeed: " + filePath);
}

function closedCB() {
  alert("Camera closed event");
}

function errorCB(e) {
  alert("Error occured: " + e); 

But I don't understand the first argument.. When I run the program, it works and shoots the camera, but when I capture the picture.. nothing happens, and the only thing I can do is  CLOSE the camera.. So when i close it.. it executes the function closedCB

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: About new Camera's API

Is this the PlayBook or BlackBerry Operating system?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 185
Registered: ‎08-17-2008
My Device: Red BlackBerry Z10
My Carrier: Vodafone

Re: About new Camera's API

See this http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Starting-up-camera-with-new-API/...

Alert not fire on SucessCB, there are an error with the RIM example

All the best
Josep Maria
Contributor
Posts: 15
Registered: ‎05-19-2011
My Device: Storm2 9550
My Carrier: Student

Re: About new Camera's API

Hey thanks for the answer!

 

tneil, I'm working with Blackberry OS

 

miamon, I watch this post.. but i couldn't solve my problem.. I supposed there's something I am missing

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: About new Camera's API

Hi emsbenitez,

 

Did you look at this post specifically as it points to code that should work. The issue with the API is that the alert will not show up while the app is in the background (which it is while the camera is showing).



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Highlighted
Contributor
Posts: 15
Registered: ‎05-19-2011
My Device: Storm2 9550
My Carrier: Student

Re: About new Camera's API

Thanks I lot.. I hadn't thought of that.. 

 

It works... =)