cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori Client Plugins

Former Member
0 Kudos

Hey Guys,

i'm searching information how to call cordova plugins (e.g. Camera, Barcodescan) within a SAP-Fiori-App.

I would like to use it with the latest Version(1.6.3 Android) of SAP Fiori Client without the use of a Kapsel-Project.

As i understand, the Fiori-Client should provid this functionality...

Thank you for your answers

Best Regards

Thomas 

Accepted Solutions (1)

Accepted Solutions (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Thomas,

Take a look at help document.

Kapsel and Cordova Plugins for SAP Fiori Client - SAP Fiori Client - SAP Library

It guides you to cordova-plugin-camera

Regards,

Masa / SAP Technology RIG

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your help! I get it working

Here my quick and dirty example code for the camera plugin. The variable imageURI contains the path to the picture on the device.

__________________________________________________________

sap.ui.define([

  "sap/ui/demo/nav/controller/BaseController"

], function (BaseController) {

  "use strict";

  return BaseController.extend("sap.ui.demo.nav.controller.Home", {

            onInit : function () {

             var me = this;

          

                navigator.camera.getPicture(me.onSuccess, me.onFail, { quality: 50,

                    destinationType: Camera.DestinationType.FILE_URI });

            },

        

            onSuccess: function(imageURI) {

                alert(imageURI);

                    var image = document.getElementById('myImage');

                    image.src = imageURI;

                 

                },

             

                 onFail: function(message) {

                    alert('Failed because: ' + message);

                }

  });

});

For Barcode Scanning use this Link Barcode Scanner Samples - SAP Fiori Client - SAP Library

Regards Thomas

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

You dont need to create a kapsel project for that, but for creating custom Fiori client , you have to run create_fiori_client.js script that is available inside KapselSDK path.

You should look at guide.

Regards,

JK