Camera

The following information shows you how to use invocation framework with Camera. See Camera for information on using the Camera API.

Opening the Camera card

Here are the invocation attributes you use for opening the Camera card:

Attribute Value
Target ID

sys.camera.card

Action

bb.action.CAPTURE

Data

photo, video, or full  (where full is the default value, in case a value is not specified) 

Here are the responses of the Camera cards:

Reason Data Description
done Not applicable This response is returned if a card is closed when a user presses the back button without initiating a capture.
close  Include an error message in the data attribute, if applicable. This response is sent when the card closes due to an error. Here are the possible errors for the card's closure that are returned in the data field of the invocation response.
  • Too many files open, picture save failed.
  • Insufficient space to save the picture.
  • Picture save failed.
save  Include a full path to the saved file.   This response is returned if a card is closed after a user takes a picture or records a video. The captured file is returned in the data field of the message.  

Opening the Camera application

Here are the invocation attributes you use for invoking the Camera application:

Attribute Value
Target ID

sys.camera.app

MIME type

image/jpeg or video/mp4

Action

bb.action.CAPTURE

Data

photo, video, or full  (full is the default if nothing is specified)

When the camera application is opened, it is not locked to any particular mode, regardless of the data parameter's description. The user can change the mode of the Camera application at any time. For example, a user can choose between the photo capture mode, video capture mode, and the timeshift mode. Also, if an instance of the Camera application is already running, it is displayed instead of a new instance being launched. Similarly, the instances that are running don't change the mode specified in the data parameter.

The following sample code shows how to invoke the Camera card in C++:
void App::InvokeCamera()
{
    bb::system::InvokeManager manager;
    bb::system::InvokeRequest request;
    request.setTarget("sys.camera.card");
    request.setMimeType("image/jpeg");
    request.setAction("bb.action.CAPTURE ");
    InvokeTargetReply *targetReply = manager.invoke(request);
    
}

Last modified: 2014-06-05



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus