cancel
Showing results for 
Search instead for 
Did you mean: 

cordova camera plugin in Launchpad

Former Member
0 Kudos

Hello Team,

We have developed a custom application with call to cordova camera plugin as below:

capturePhoto: function(){

     var oNav = navigator.camera;

     oNav.getPicture(this.onPhotoSuccess, this.onFail,

     {

          quality: 10,

          destinationType: oNav.DestinationType.DATA_URL,

          saveToPhotoAlbum; true   

     }

},

onPhotoSuccess: function(imageData){

     var oImage = this.getView().byId("myImage");

     oImage.setSrc("data:image/jpeg;base64", imageData);

}

With this, I am able to call the camera from application in desktop preview.

But, when I am trying with deploying to Launchpad, I am not able to call the camera API.

Please suggest.

Regards,

Ajay

Accepted Solutions (0)

Answers (1)

Answers (1)

jamie_cawley
Advisor
Advisor
0 Kudos

How are you previewing the app and are you running this in the fiori client?  Web IDE has the cordova facade configured within it which allows you to test cordova features in a desktop browser.  This wouldn't be available outside of Web IDE without modification.  You also have some typos in your code, semicolon next to saveToPhotoAlbum and you are missing a bracket which may be your issue.


Regards,

Jamie

SAP - Technology RIG

Former Member
0 Kudos

Hi Jamie,

As you said, Web IDE has the cordova façade configured, so I am able to test cordova features in desktop browser.

But, I have checked barcode scanner plugin in Fiori client as below:

cordova.plugins.barcodeScanner.scan(onSuccess, onFail);

With this, I am able launch the barcode scanner cordova plugin from device/Tablet.

Could you please tell me, how do we access the camera API in similar fashion.

Yes, I believe that's a typo in my question, but in my code I have it in right way.

Regards,

Ajay

jamie_cawley
Advisor
Advisor
0 Kudos

What are you seeing in the log file of the fiori client?

Regards,

Jamie

SAP - Technology RIG

Former Member
0 Kudos

Thanks Jamie.

Got it worked with clearing Fiori client cache.

Regards,

Ajay