Update: SMP 3 was released. HANA Cloud Platform mobile services (HCPms, cloud version of SMP) supports all Kapsel Plugins. HCPms replaced SMP on Cloud.

SAP Kapsel is a set of plugins for Apache Cordova (open source) that provides a subset of the capabilities provided by Hybrid web container, and it is replacing the HWC in SMP 3. ie SMP 3 will not have HWC apps, we have to use these plugins during the development of hybrid apps.

droid@screen-9.png

Since Kapsel is a part of SMP 3, and SMP 3 is not yet released I was looking for a way to test the Kapsel plugins and found it working with SMP on HANA cloud. But I am not sure whether all kapsel plugins are officially supported by SMP on Cloud since the cloud version has difference with on premise. If you are interested to try Kapsel Logon plugin in an Android device you can follow these steps.

Sign up for a free trial of SMP, cloud version: SAP HANA Cloud Platform

Register for NWGW trial, http://scn.sap.com/community/developer-center/netweaver-gateway

Download and install SMP 3 SDK (tested with SMP 3 SP01) from SAP Service Market Place

Install Cordova in your system (version 3.1.0-0.2.0), Apache Cordova

Create a cordova project

Create a new folder to keep the Kapsel projects.

Use the command cordova -d create C:\Kapsel_Projects\LogonDemo com.opensap.myfirst to create a new project.

Add the android platform to the project using the below command

cordova -d platform add android

ScreenHunter_89 May. 01 15.32.jpg

Add Kapsel plugins to the application

Make sure you are inside the project path and use the below command to add the Kapsel Logon plugin to your project.

cordova -d plugin add C:\SAP\MobileSDK3\KapselSDK\plugins\logon

ScreenHunter_92 May. 01 19.57.jpg

Replace www\index.html with the contents of index.html – Google Drive. (Note: This code sample is taken from Getting Started with Kapsel – Part 2 — Logon)

Prepare the project using the command cordova -d prepare

ScreenHunter_90 May. 01 15.41.jpg

Create application in SMP Cloud

Odata end point URL used, https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/

Application properties:

ScreenHunter_91 May. 01 18.30.jpgScreenHunter_92 May. 01 18.30.jpgScreenHunter_89 May. 01 15.03.jpg

Install Certificate in device for HTTPS

To make a HTTPS connection to SMP server a certificate needs to be installed in the device. Export the certificate from SAP on Cloud>paste it to device storage>install. More information on installing a certificate in Android device, Add SSL Certificate to Android

ScreenHunter_93 May. 05 11.15.jpgdroid@screen-1.png

Run the app !!

Finally, import the cordova project created to Eclipse IDE and run the app in an Android device.

droid@screen-2.pngdroid@screen-9.pngdroid@screen-5.pngdroid@screen-6.png

Find registered user in SMP cloud cockpit.

ScreenHunter_91 May. 01 18.26.jpg

Happy Hacking!!

Midhun VP

@midhunvptwit

To report this post you need to login first.

12 Comments

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

    1. Parag Jain

      Hello Daniel,

      Would this be the same for native apps as well developed using SMP 2.3 / 3.0 SDK  with OData feed from backend ? I assume our existing SMP 2.3 SDK developed native apps would be able to work with SMP cloud version with some minor changes. Any guides to try that out like the one you created for Kapsel.

      Regards,

      Parag.

      (0) 
    1. Daniel Van Leeuwen

      I would suggest checking to see which plugins have been installed into your project.

      In a command prompt change to the directory of your project (LogonDemo) and run

      cordova plugins

      This should list the plugin

      com.sap.mp.cordova.plugins.logon

      If it is not shown, try adding the plugin again

      cordova -d plugin add C:\SAP\MobileSDK3\KapselSDK\plugins\logon


      and make sure there are no errors shown.


      Another option would be to try use the Web Inspector to debug your page.


      Getting Started with Kapsel – Appendix B — Debugging

      (0) 
  1. AnilKumar Vippagunta

    Hi,

    We are getting below error. Pleast suggest ?

    I see the below plugins registered.

    C:\SMP\Kapsel_Project\Project>cordova plugin list

    com.sap.mp.cordova.plugins.corelibs 3.4.0 “CoreLibs”

    com.sap.mp.cordova.plugins.logger 3.4.0 “Logger”

    com.sap.mp.cordova.plugins.logon 3.4.0 “Logon”

    org.apache.cordova.console 0.2.9 “Console”

    org.apache.cordova.device 0.2.10 “Device”

    org.apache.cordova.inappbrowser 0.5.0 “InAppBrowser”

    Capture.JPG

    Regards, Anil

    (0) 
  2. DineshChakkravarthi Rajagopal

    Hi Midhun,

    I have exactly followed the steps which is mentioned in your blog, but a difference is i have a SMP server running in my desktop. and i tried to connect with my mobile application both are in same network. I am getting lot of CORS error. Can you please help me on this.

    -Dinesh

    (0) 

Leave a Reply