Camera

The following information shows you how to use the invocation framework with the Camera app. 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  Includes an error message in the data attribute, if applicable. This response is returned 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  Includes 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 app

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

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 app 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 app 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 app is already running, it is displayed instead of a new instance being started. 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-09-30



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

comments powered by Disqus