cancel
Showing results for 
Search instead for 
Did you mean: 

S.U.P. 2.1 CAMERA.JS

asdasd_asdasd
Active Participant
0 Kudos

hello all,

I'm trying to implement the camera but I did not hit my code is as follows:

var options;

getPicture (onLRPM1, onLRPM2, options);

I'm getting the error "-4", which according to documentation () Means "/ ** Supplied Were Not Recognized options. * / PictureError.BAD_OPTIONS = -4;

".

According to the documentation the options parameter should be:

"options - picture options:

PictureOptions.CAMERA - the picture is stored in the camera application folder

PictureOptions.PHOTOLIBRARY - a photo chooser dialog is native Shown, from Which a photo from a file Can be selected (JPEG only). "

But as I do in javascript?, Someone has already used the API?

regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Without seeing what you have defined as onLRPM1, onLRPM2 and options, this is difficult to say.

The first parameter to the getPicture function is expecting a function to call if this function fails. The second parameter is expecting a function to call when this call succeeds. The third parameter is used to specify whether to get the picture from the device's camera, or photo library.

Here is a simple example using the device's camera. Change PictureOption.CAMERA to PictureOption.PHOTOLIBRARY if you wish to select a photo from the device's photo library instead.

// A function invoked by a manual button press

function getCameraPicture()

{

getPicture(function(err) { logToWorkflow("Camera error=" + err); },

function(data) { logToWorkflow("Camera success len=" + data.length); },

PictureOption.CAMERA);

};

You should replace the logToWorkflow call with something you wish to do with the returned data.

Hope this helps,

Andrew.

asdasd_asdasd
Active Participant
0 Kudos

solved by myself

Former Member
0 Kudos

Hi can you explain how did u did that?

&

Is it possible to integrate the camera in Workflow app???

asdasd_asdasd
Active Participant
0 Kudos

open a new thread