Skip to Content
avatar image
Former Member

SAP Fiori Client Plugins

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 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 20, 2016 at 01:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • May 20, 2016 at 07:28 AM

    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 Getting Started with Kapsel - SAP Fiori Client (SP09+) guide.

    Regards,

    JK

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 23, 2016 at 06:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded