SAP Fiori Cordova Plugin to connect an external Honeywell printer
Satyaki Basak
★Founder - ROITech - The SAP Fiori Factory ★ Helping companies solve SAP Enterprise Mobility challenges
We all know that SAP Fiori comes with a set of Cordova plugins using which we can access the native features of the mobile device, e.g. Phone Camera, to our Fiori application. This is a very useful feature with which we can use the same Fiori application to run in the browser and also on the mobile device with some of the native capabilities.
But what if we need to connect to an external device, e.g. Printer? What if the plugin does not exist?
In this scenario, we experimented with connecting an Android application to a Honeywell Bluetooth Printer.
Let’s print “Hello World”?
Here we are going to develop a simple Android application with which we will print “Hello World” on the external Honeywell Printer.
Below is the project structure for the Android Application.
Writing the Print function
Now we need to write the Print function from where we will call the required methods of the jar file. As you can see we have to create an object and call the functions using that object.
Permissions - Manifest file
As this app is going to use Bluetooth, we need to ensure that the permission is given by the user in order to run the application properly. We would need the following 2 permissions to be given.
Run the application
Now that your Class is ready, build your Custom Plugin in the way we discussed in one of our earlier blogs. Add this custom plugin to your application, and Voila, your application is ready to print.
@Team ROITech - Your SAP Fiori Factory,
Hope you found this blog interesting and useful. In case if you come across any problems with SAP Fiori, we would be happy to help you with a solution.