on 10-23-2015 12:12 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.