How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

Time:2022-5-17

The previous articles in this tutorial are a small series around SAP ui5 and Cordova:

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

The rest of this article describes how to enable in a Cordova applicationcordova-plugin-barcodescanner.

The effects achieved are as follows:

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

choiceOnly allowed when using this appJust.

Before we allow this request, hellocordova is applied on the mobile phoneset upIn the panel, in thejurisdictionIt shows thatNo permission required

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

After allowing the Cordova app to request a camera application,jurisdictionThe panel displays as follows:

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

Now you can use the mobile camera to scan the bar code:

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

The interface of successful scanning is shown in the following figure:

How to use the standard control of SAP ui5 combined with Cordova plug-in to call the mobile camera for bar code scanning trial version

Refer to this article for detailed stepsarticle