Skip to Content

Cordova barcode scanner unable to open camera on ui5 app(desktop)

Hi,

Cordova barcode scanner plugin is unable to open camera in ui5 app due to error in quagga.min.js file which is coming from SAP Cloud Platform. Here is the source URL: "

https://webidecp-a*******6.dispatcher.hana.ondemand.com/hatdi_acf0c8a6f/hybrid/cordovafacade/plugins/com.sap.mp.cordova.plugins.barcodescanner/src/browser/quagga.min.js

".

quaggamin-copy.txt

Camera permission was given. Few days back scanning was working on desktop app, but since yesterday i am getting white screen instead of camera. I can see white led light on beside camera lens of laptop. This app is working fine on fiori client.

The following details are with respect to the same app on SAP Cloud Platform Portal Service (Fiori Launchpad):

1. cordova is being detected on web ide (index.html run), but it is not available on Portal Service. I don't understand why the difference in behavior when the code is same across both services. I can only run this app on fiori client(App deployed on SAP Portal).

cordova-barcode-scan-plugin-issue-on-scp-portal.jpg

2. Application folder contents are divided into two separate folders - "sap/fiori/application" and "sites". Why this happens. Please refer image file for details. This kind of folder structure creates issue for rendering custom image on app. I had to go with a workaround for displaying custom images in app on Fiori launchpad.

3. View controller source code appears in single line, where as on Web IDE full stack it is displayed in proper format. I have to click on Pretty-print option to get it displayed in proper format(as displayed in above image). Local variables are replaced with run time variable names, which some times makes debugging difficult. Why this happens?

Lastly, How does one debug an app in SAP Fiori Client?

Please help me understand why so many things are behaving differently.

Thank you.

Regards,

Saurabh Singh.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 14, 2018 at 11:37 AM

    Hi Saurabh Singh

    1. Cordova plugins only works with mobile devices. They are designed for that. If you want to use camera or other features from laptop via browser app directly, there are some open source libraries for that, even sap has a few.

    2. Not sure about that

    3. When you push the applcication to cloud or abap backedn system, sap uses the grunt file to minimify the code, so the payload size will be reduced. If you want to get the original source code, use the blog below, note: the ui is changed a lot now from the blog but I am sure you can find the option easily :)

    https://blogs.sap.com/2016/09/30/how-to-debug-ui-code-of-a-fiori-application/

    4. If you want to debug the app in the fiori client, you need to connect it to mobile and use the chrome developer options.. from there it is regular javascript(ui5) app debugging.

    https://software.intel.com/en-us/xdk/docs/using-remote-chrome-devtools-to-debug-android-cordova-apps

    You can find many other blogs which has similar content.

    BR,

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded