Hybrid Mobile App with SAP MII as Backend
This blog is regarding development of a hybrid mobile app using Phonegap with SAP MII as backend. We can create Web Pages Dashboards or Reports using SAP MII Workbench. We can open those pages in Tablet/Smartphone’s browser also. But if the requirement is there for an application then there are multiple ways by which we can create an app. One of them is to use Apache Cordova/Phonegap.
What is Apache Cordova/Phonegap?
How do we create a hybrid app using Phonegap?
- We can install Phonegap CLI (Command Line Interface) using following link http://docs.phonegap.com/getting-started/1-install-phonegap/cli/
- Once installed we can create app using following link http://docs.phonegap.com/getting-started/3-create-your-app/cli/
- Once the app project is created in Phonegap directory, we can put all the web code in “www” folder.
- Then, we need to add platform specific libraries to phonegap project. For example: To add Android specific lib, Go to Command Line -> Change Dir to project root folder -> Type command :
>phonegap platform add android --save
- We can test the app on desktop web browser using Phonegap server. For this we need to open cmd prompt (for windows). Then go to project directory using “cd” command. Then type command “phonegap serve”. This will give a URL on which the application will be hosted.
This way we can test the app before deploying on device.
How do we deploy application project from Phonegap to Android device?
- First, we need to install Android Studio from Android web site. (https://developer.android.com/studio/index.html )
- Once Android Studio is installed, we can import Phonegap project in Android Studio by going to “File -> New -> Import Project”.
- Then, we can see the project in the workspace.
- We can connect the device via USB port. Once device is detected, click on the Run icon in green to deploy the application on the device.
How do we connect hybrid application with SAP MII to run Transactions?
http://<serverName>:<portNo>/XMII/Illuminator?QueryTemplate=< XacuteQueryName> &Param.1=”+p1+”&Param.2=”+p2+”Content-Type=text/xml&IllumLoginName=”+username+”&IllumLoginPassword=”+password
With all the above steps we can create a Hybrid mobile application that can get data from SAP MII Transactions. Please feel free to comment on the blog and suggest your invaluable improvements.
Great blog! Hybrid apps, such a great and easy to use technology, and btw. SAP offers via its HANA Cloud Platform services for hybrid app developers to be able to go completely to the cloud, no need for a mobile toolchain on your workstation anymore. Just using WEB IDE and the mobile services for SAP Fiori, you can build hybrid apps in the cloud. Learn more here
While consuming SAP MII web service URL from SAP UI5 application, is there any way to implement the SSO so that we don't need to pass Username and password for MII server in URL?