Get your hands dirty by trying Kapsel with SMP Cloud
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.
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
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
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
Create application in SMP Cloud
Odata end point URL used, https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/
Application properties:
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
Run the app !!
Finally, import the cordova project created to Eclipse IDE and run the app in an Android device.
Find registered user in SMP cloud cockpit.
Happy Hacking!!
Midhun VP
@midhunvptwit
Enjoyed reading the blog ! Thank you..
Good one. All information about kapsel usage under one umbrella.
Nice blog Midhun !
Great that SAP is also including KAPSEL (At least some of the plugins) in the Cloud version of SMP 🙂
The following document may also be helpful.
Getting Started with Kapsel - Appendix J -- SMP Server Cloud Version
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.
You can use the Odata SDK comes with SMP 2.3 with the SMP cloud too.
Midhun VP
Great!!! Any experience around this ? Proof-of-Concept or a productive application ?
Regards,
Parag.
This might help you to understand how Odata is to connect with SMP on cloud from a native app. You can download the sample projects too,https://open.sap.com/course/mobile1
Midhun VP
Hi,
We are getting a error,while running app in android simulator,
which is SAP is not defined in index.html,
I have copied and pasted the code from index.html from
index.html - Google Drive
Please guide
Regards,
Lekhak patil
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
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"
Regards, Anil
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