Skip to Content

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?

Phonegap is an open source mobile application framework that enables development of mobile application using HTML, JavaScript and CSS. This type of application are called as Hybrid applications. Code development in hybrid app is irrespective of platform like Android, iOS etc.
How do we create a hybrid app using Phonegap?

  1. We can install Phonegap CLI (Command Line Interface) using following link http://docs.phonegap.com/getting-started/1-install-phonegap/cli/
  2. Once installed we can create app using following link http://docs.phonegap.com/getting-started/3-create-your-app/cli/
  3. Once the app project is created in Phonegap directory, we can put all the web code in “www” folder.
  4. 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
  5. 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?

  1. First, we need to install Android Studio from Android web site. (https://developer.android.com/studio/index.html )
  2. Once Android Studio is installed, we can import Phonegap project in Android Studio by going to “File -> New -> Import Project”.
  3. Then, we can see the project in the workspace.
  4. 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?

We can fire Ajax call from application’s JavaScript code. The URL for Ajax should contain following parameters:·

  • QueryTemplate
  • Params
  • Content-Type
  • IllumLoginName
  • IllumLoginPassword

Example URL:

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.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Johannes Alberti

    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

    https://hcp.sap.com/capabilities/mobile/fiori-mobile.html

    https://blogs.sap.com/2016/10/11/fiori-mobile-service-developer-experience-arrived/

    https://blogs.sap.com/tag/fiori-mobile/

    (0) 
  2. Sneha Jadhav

    Hi Anshul,

     

    Helpful blog.

    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?

     

    Thanks,

    Sneha

     

    (0) 

Leave a Reply