/wp-content/uploads/2013/11/sap_logo_333927.png

SAP Mobile Platform 3.0

Getting Started with Kapsel

Note, that there were significant changes to the Kapsel plugins when moving from SP08 to SP09 and the move from Cordova 4.2.0 to 5.1.1. The following instructions are for SP08. If you are using a newer version of the SDK, please see Getting Started with Kapsel in SP09+.

Overview

One type of mobile app that can be written using the SAP Mobile Platform 3.0 (SMP 3.0) is an HTML5 hybrid app or Kapsel app.  Apache Cordova is an open source project that provides a container which includes a browser that renders the UI of the application and a set of API’s callable from JavaScript to access native device functionality such as the device’s camera and contacts list.  The benefit of this is that the same UI code (HTML/CSS) and business logic code (JavaScript) can be deployed on multiple platforms such as iOS and Android without code modifications.  For a complete list of Kapsel supported device versions see SAP Mobile SDK Supported Devices Operating Systems, Product Availability Matrix and Supported Kapsel Plugins for Windows 8.1 and Windows 8.1 Phone.    The list of Apache Cordova API’s including sample code is available at API Reference.  Apache Cordova itself can be extended to provide additional native device functionality.  For additional details on writing a Cordova plugin see Plugin Development Guide.

Kapsel is a set of plugins that enhance Apache Cordova with functionality such as a stream-lined logon to an SMP 3.0 server, the ability to update deployed applications, encrypted storage and push notifications.  For more information see SMP 3.0 Enablement, the Kapsel specific enablement page at SMP 3.0 for Developers – Hybrid Apps, the blog posts by John Wargo, Kiran Karunakaran the SMP SDK product manager, the roadmap for SMP at http://service.sap.com/saproadmaps and the SAP Web IDE.

Setup

Kapsel apps can be developed on Windows or Mac machines.  Kapsel apps can target Android, iOS and as of SP05 Windows 8.1 and Windows 8.1 Phone.  Development for an iOS device must occur on a Mac machine.  Android development can occur on a Windows or Mac machine.  See also Creating an Application on Windows 8.1 and Windows 8.1 Phone.

SMP 3.0

The SAP Mobile Platform and the SAP Mobile Platform SDK can be downloaded from the SAP Software Download Center.  Additionally, a trial version of the SAP Mobile SDK is available at SMP 3.0 Mobile SDK Trial.  The cloud version of the SMP server named SAP HANA Cloud Platform mobile services or HCPms server is also available as a trial.  The examples shown in this guide were tested using the SP08 PL01 SDK and the on premise SP07 server and it is recommended that theses versions or newer be used when following the examples.  Note, that the server and SDK are on different release schedules.

Two files need to be downloaded to install the SAP Mobile Platform 3.0.  The 3.0 SP08 SDK and the 3.0 SP07 on premise server.  The latest patch levels or PLs should also be applied.
image13.PNG

Under Installation & Upgrades, A-Z Alphabetical List of my Products > M >  SAP Mobile Platform SDK > SAP Mobile Platform SDK 3.0 > Support Packages > SAP Mobile Platform SDK 3.0 > Windows on x64 64-bit > EBF 3.0 SP08.

Click on M > SAP Mobile Platform > SAP Mobile Platform 3.0 > Support Packages and Patches > SAP Mobile Platform Runtime 3.0 > Windows on x64 64bit and download EBF 3.0 SP07.

To double check what version of the SDK installed, edit a plugin’s plugin.xml file.  It should contain a version field such as the one shown below.

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    id="com.sap.mp.cordova.plugins.logon"
    version="3.8.0">

The SMP server is a bit more tricky to determine its version.  There are multiple places where it indicates a version.  The most reliable may be to look at C:\SAP\MobilePlatform3\smp_product_info.xml.  It should contain a version field as the one shown below.

<product name="SMPServer" version="3.0.7.0" compatibilityVersions="3.0.*">

One other place is in the top right of the management cockpit.


Additional Required Software

The Apache Cordova command line will generate a project that can then be built using Android SDK or Xcode.

The Android  SDK also requires Java to run. Note, that as of SP08 of the Kapsel SDK with Cordova 4.2, it is still recommended to use Eclipse with the Android SDK.  See Installing the Eclipse PluginAndroid Studio will be replacing the ADT plugin for Eclipse in a future release.  To successfully use Apache Cordova for Android, a JAVA_HOME variable must be specified and it should be added to the windows path.

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45
PATH=%PATH%;%JAVA_HOME%\bin;

The Android SDK tools\bin folder also needs to be added to the windows and mac (.bash_profile) path.

PATH=%PATH%;C:\Android\sdk\tools

or

export PATH=$PATH:~/Downloads/adt-bundle-mac-x86_64-20130522/sdk/tools

If you are using Windows, Git for windows is a prerequisite and must be in the path.  Git can be installed from Git for Windows or git-scm.

On a Mac, Git is installed as part of Xcode.  The following commands can be used in OS X to view the version installed and to verify that it is on the path.

git --version
pkgutil --file-info /usr/bin/git
echo $PATH

If needed it can be installed from Git for Mac.

Finally if using Android, ant should be installed and added to the path.

PATH=%PATH%;C:\apache-ant-1.9.4\bin

Accessing the SAP OData Gateway Demo

Kapsel apps communicate with backend enterprise systems primarily by using OData.  For additional information on OData see Appendix A:  OData.  SAP provides a publicly available OData endpoint at SAP Netweaver Gateway Demo System.  Some of the samples in this guide will utilize this.  Follow the instructions on the previously provided link to receive a user name and password necessary for accessing the OData source used throughout this guide.

Ensure that the OData endpoint can be accessed by opening it in a browser.

https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT

Enter the provided user name and password.
image3.PNG

CarrierCollection is the collection that will be used.
image4.PNG

CarrierCollection returns a list of airlines.
image5.PNG

Note that the option ?sap-ds-debug=true can be used with SAP Netweaver Gateway OData sources.  This causes HTML to be returned to the browser enabling the content to be displayed in an easier to read format and the links become clickable.

Notice that https is used.  The following step adds the certificate of the SAP Netweaver Gateway server to the SMP 3.0 server.  This is needed as the SMP 3.0 keystore

C:\SAP\MobilePlatform3\Server\configuration\smp_keystore.jks

does not contain the trusted root certificate that was used to sign the certificate used by the SAP Netweaver Gateway server.

Right-click and choose View page info > Connection > Certificate Information.
image6.PNG

Click on the Details tab, Copy To File… to export the certificate to a local cer file which can then be imported into the SMP 3.0 server’s keystore.
image7.PNG

C:\SAP\MobilePlatform3\Server\configuration>keytool -import -v -alias sapgatewaycert -keystore smp_keystore.jks -storepass changeit -file c:\certs\sapgatewaycert.cer

Note, the password shown above, changeit, was a value that was requested during the SMP 3.0 server install.  Replace changeit with the value you specified during the install.

Note that the SMP 3.0 server needs to be restarted after making this change.

The above step demonstrates how to enable the SMP 3.0 server to trust the OData server’s certificate by installing the certificate (sapgatewaycert.cer) into the SMP 3.0 server’s keystore.  Alternatively, the certificate belonging to the entity that signed the OData server’s certificate (Starfield) could be installed.
Here are a few more useful keytool commands

keytool -list -v -keystore smp_keystore.jks
keytool -list -v -keystore smp_keystore.jks -alias sapgatewaycert
keytool -delete -alias sapgatewaycert -keystore smp_keystore.jks

Configuring a Kapsel App in the Management Cockpit

The SMP 3.0 server provides authentication, logging and the ability to rewrite the URLs of an OData endpoint.  The SMP authentication providers enable the use of an existing authentication system to authenticate users accessing mobile applications.  Rewriting URL’s can hide from the end user the host name of the OData endpoint.

The following steps will demonstrate how to configure a new hybrid or Kapsel app in the SMP 3.0 management cockpit.

Create a new application in the management cockpit.  The management cockpit can be accessed at https://localhost:8083/Admin/.

The default user is smpAdmin and password is whatever was specified during the install.

Click on Applications > New.  The id is

com.mycompany.logon

image9.PNG

The OData endpoint URL is

https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT

image10.PNG

Under SSO Mechanisms, click on Add > Technical User (Basic) and specify the user name and password used to access the OData backend system.
image14.PNG

The Use System Proxy should be checked if the computer uses a proxy server.  The values for the system proxy are set in the management cockpit under Settings > System.
image8.PNG

It is also recommended to set http.nonProxyHosts setting when using the http.proxyHosts setting if using the httpAuthentication provider against a server within your corporate network.

Under the Authentication tab, the simplest thing to do is to choose the default configuration.  When the No Authentication Challenge authentication provider is used, any user name and password passed to the SMP server will succeed during the registration process.image11.PNG

In a non demo scenario, one of the other authentication providers would be used.

image15.PNG

An alternate setup would be to use the Basic SSO mechanism with the HTTP/HTTPS Authentication provider.  Note the HTTPS Authentication provider does not currently work with a URL that requires a proxy to reach it.

The following screenshot shows the result of a registration done using the No Authentication provider and the HTTP Authentication provider.  With the No Authentication provider, each user apears with a user name of nosec_identity.  The steps to perform the registration are covered in the Logon plugin section.
image16.PNG

Ping the endpoint to confirm that it is correctly configured.
image12.PNG

The application is now configured in the SMP 3.0 server and ready to be implemented.

Installing Apache Cordova with Node.js

Note, execute the following commands using the Windows command prompt or the OS X terminal.

If necessary, download and install Node.js from nodejs.org/download.

Node.js and its package manager npm can be used to install Apache Cordova.  The version installed can be seen by the following node command

node -v
v0.10.26

I would recommend using the latest available 0.10.x version.  The following error occurs when using Cordova 4.3.0 and Node 0.12.1.

Request path contains unescaped characters

To see what packages are already globally installed use

npm ls -g

Use npm to install the Apache Cordova command-line interface.
Cordova 3.0.6 (or the latest 3.0.x version) should be used if using SMP 3.0 SDK.
Cordova 3.1.0-0.2.0 (or the latest 3.1.x version) should be used if using SMP 3.0 SP01 SDK.
Cordova 3.3.1-0.1.2 (or the latest 3.3.x version) should be used if using SMP 3.0 SP02 SDK.
Cordova 3.4.0-0.1.3 should be used if using SMP 3.0 SP03 SDK.
Cordova 3.4.1-0.1.0 should be used if using SMP 3.0 SP04 SDK.

Cordova 3.5.0-0.2.7 (or the latest 3.5.x version) should be used if using SMP 3.0 SP05 SDK.

Cordova 3.6.3-0.2.13 (or the latest 3.6.x version) should be used if using SMP 3.0 SP05 PL03 or SP06 SDK.

Cordova 4.2.0 should be used if using SMP 3.0 SP07 SDK.

Cordova 4.2.0 should be used if using SMP 3.0 SP08 SDK.

For SP09 see Getting Started with Kapsel in SP09+

Note, it is possible to use Cordova 4.3.0 with SP08 of the SDK but it requires using the following format when adding Kapsel plugins.

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

or

cordova plugin add com.sap.mp.cordova.plugins.logon --searchpath C:\SAP\MobileSDK3\KapselSDK\plugins

Additional information is available at The Command-line Interface.

npm install -g cordova@4.2.0
npm ls -g cordova or cordova -v

Note, the -g indicates that Apache Cordova should be installed globally.  It will be placed at the location indicated by

npm root -g

Note if you are on a Mac, use

sudo npm install -g cordova@4.2.0

A specific version of Apache Cordova can be installed by specifying a version number or if the version number is not supplied then the latest version is installed.

npm install -g cordova@4.2.0

The available versions can be seen with the info command.

npm info cordova

Note, if you use a proxy server you will need to configure npm, git and plugman as shown below.

npm config set proxy http://proxy:8080
npm config set https-proxy http://proxy:8080

git config --global http.proxy http://proxy:8080
git config --global https.proxy http://proxy:8080

Create a file named C:\Users\i82xxx\.plugman\config or /Users/i82xxx/.plugman/config.

Specify a proxy such as proxy=http://proxy.phl.sap.corp:8080

See also CB-5017.

If these are not set an error similar to the one shown below may appear when creating a project.

[Error: downloaded www assets in /Users/user_name/.cordova/lib/www/cordova/4.0.0/www does not contain index.html, or www subdir with index.html]

If this happens, delete C:\Users\user\.cordova\, set the proxy settings and rerun the create command.

The following are for illustration purposes and demonstrate how to list the current proxy settings and remove the proxy settings.

npm config list

npm config get proxy
npm config get https-proxy
npm config delete proxy
npm config delete https-proxy

git var -l
git config --global --get http.proxy
git config --global --get https.proxy
git config --global --unset http.proxy
git config --global --unset https.proxy

Uninstalling Apache Cordova

Cordova can be uninstalled by

npm uninstall -g cordova
npm cache clean

After performing the uninstall, if the following folder exists, you may wish to also delete it.

C:\Users\user\.cordova

or on a Mac

~/users/user/.cordova

Creating an Apache Cordova Project

The command-line interface or CLI is used to create Cordova projects.  For additional details see Command-line Interface.

Create a folder to hold the Kapsel projects such as C:\Kapsel_Projects or ~/Documents/Kapsel_Projects
A new project can now be created using

cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}" 

or on a Mac

cordova -d create ~/Documents/Kapsel_Projects/LogonDemo com.mycompany.logondemo LogonDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"

When installing plugins, the CLI expects plugins to be installable from the hosted Apache Cordova plugins registry.  The plugin_search_path parameter provides a location where local plugins can be found.  It is now required when using Kapsel plugins in SP04.  In previous versions of Kapsel there was a local .git folder that was being used to resolve the location of dependent Kapsel plugins.  The search path value is stored in C:\Kapsel_Projects\LogonDemo\.cordova\config.json or  ~/Documents/Kapsel_Projects/LogonDemo/.cordova/config.json.  Note it is also possible to specify a searchpath when adding a plugin.  Type cordova help and examine the plugin add command for additional details.

The first parameter following create is the directory to create the project, followed by a reverse-domain-style identifier, followed by the project name and then a JSON string defining where to find the Kapsel plugins when they are added to this project.
Note, this may take a few minutes to complete as an initial download of the template project that will be used has to be downloaded to

C:\Users\user\.cordova

or

~/users/user/.cordova

Note, the -d flag indicates debug output and is optional but can be useful the first time this is run in case something goes wrong.

Note, on a Mac, if the above command fails due to a permission problem, it may be necessary to provide execute rights to the folder where Cordova was installed.

cd /usr/local
sudo chmod +r+x bin

To add a platform run the following command

cd C:\Kapsel_Projects\LogonDemo or cd ~/Documents/Kapsel_Projects/LogonDemo
cordova -d platform add android

or

cordova -d platform add ios

or both at once if you are on a Mac

cordova -d platform add android ios

At this point,

LogonDemo\www

contains the HTML, JavaScript and CSS used by the project. 
image1.PNG

The files contained in here are the ones that should be modified.  A duplicate set of the files are included in each of the below directories.

LogonDemo\platforms\android\assets\www
LogonDemo\platfoms\ios\www

image2.PNG

A plugin can be added with the following command.  The below plugin enables console.log to display log messages.

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

For a list of additional plugins click on one of the API’s such as Camera at Plugin APIs.

Changes would now be made to index.html file followed by calling the prepare command to copy the files in the project/www folder to the platform specific www folders.

cordova -d prepare android ios

At this point the project can be opened in a development environment such as Xcode or the Eclipse IDE that includes the Android Development Tools plugin.  Alternatively, the cordova command line can also be used to build and deploy the project.

The following are a few examples using the Cordova CLI and the Android SDK.

cordova compile android (creates an apk file that can then be installed)
emulator -avd Android51 (starts an existing Android emulator named Android51)
adb install platforms/android/ant-build/CordovaApp-debug.apk (installs the app on a running device or emulator)
cordova run android (performs a cordova prepare, then builds the apk and installs the app and runs it)

Note to open the project in Eclipse and then run it choose File > Import > Android > Existing Android Code Into Workspace. 
Note that with Cordova 4.2.0, an additional step is needed to enable the project to build in Eclipse.  Right-click on the project and choose properties > Java Build Path > Libraries > Add Jars > CordovaApp-CordovaLIb > bin > cordovaapp-cordovalib.jar.  Under the tab Order and Export check cordovaapp-cordovalib.jar.
Then right-click on the project and choose Run As > Android Application.

To open the project in Xcode, double click on the file

~/Documents/Kapsel_Projects/LogonDemo/platforms/ios/LogonDemo.xcodeproj

Kapsel Plugins

The following sections provide step by step instructions demonstrating each Kapsel plugin and a set of appendices on topics related to Kapsel app development.  Note some of the plugins mentioned below such as the Barcode Scanner, Calendar, and Print plugins are based on third party plugins. They are included in the Kapsel SDK for your convenience.
Logon
AppUpdate
Push
EncryptedStorage
Logger
Settings
AuthProxy
Online Application (New in SP04)
Toolbar (New in SP04)
Barcode Scanner (New in SP04)
Application Preferences (New in SP04)
Cache Manager (New in SP04)
SAP Fiori Client (New in SP04)
Offline OData (New in SP05)
End-To-End Trace (New in SP05)
Attachment Viewer (New in SP05 PL03)

Calendar (New in SP06)

Printer (New in SP06)

Voice Recording (New in SP08)

Appendix A:  OData
Appendix B:  Debugging
Appendix C:  UI Frameworks
Appendix D:  Security
Appendix E:  Upgrading
Appendix F:  Tips
Appendix G:  New Features
Appendix H:  Non Kapsel Plugins
Appendix I:  SAP Afaria and Kapsel
Appendix J:  SMP Server Cloud Version
Appendix K:  Hybrid Apps in SAP Mobile Platform 2.3 and 3.0
Appendix L:  Crosswalk
Appendix M: SAP HANA Cloud Platform Mobile Services (HCPms)
Appendix N: Using SAML with Kapsel

Note that comments are not easily searchable in SCN.  If you have a question that is not specific to the above content it would be best to create a new discussion on SCN.
To include a reference to this document, Right Click on the title and select ‘Copy Shortcut’.  Paste it into the newDiscussion so people will know the relevance.  If you want to bring it to the attention of the author, repeat the same process with the Author’s name.

To report this post you need to login first.

81 Comments

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

  1. Eugene Yew

    Thanks for sharing this post.

     

    I’m getting an error with the ping test failing. In the log, I see “#+00#ERROR#com.sap.mobile.platform.server.online.admin.ping.PingService##anonymous#http-bio-8083-exec-1###Exception:::Root cause::: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated|”

     

    Not sure if it’s related but I noticed that “keytool” is found in two locations (but not the path shown in the post) on my server.

     

    The import works with my keystore password if I run it from “C:\SAP\MobilePlatform3\sapjvm_7\jre\bin”, but if I run it from “C:\SAP\MobilePlatform3\sapjvm\bin

    I get an error that the “Keystore was tampered with, or password was incorrect”.

     

    I assume that the “jre\bin” folder is where the import should be run from but that’s the only difference from my steps. Restarted service and server after the import.

     

    Am not using proxies and the I can access the endpoint directly from browser on the server.

     

    Thanks in advance for any suggestions.

    (0) 
    1. Daniel Van Leeuwen Post author

      My path includes c:\Program Files\Java\jdk1.7.0_45\bin.  I believe that is the version of keytool that I am using.

       

      Have you restarted the SMP 3.0 server after making the change to smp_keystore.jks?

      (0) 
      1. Eugene Yew

        Yes, I restarted the server after making the change. I noticed I only had the JRE, not JDK so installed it, added JDK bin to my path, ran keytool again to delete, re-import, re-started the server.

        Also tried deleting that application entry, re-created it, same results, same message in log. Any other suggestions ? Thanks !

         

        Assuming it shouldn’t make a difference but am running this in EC2 and I can access the endpoint from the server browser.

        (0) 
        1. Daniel Van Leeuwen Post author

          I tried to replicate the problem.  If I remove the certificate from the keystore and perform a ping I get the same error message.

           

          com.sap.mobile.platform.server.online.admin.ping.PingService##anonymous#http-bio-8083-exec-3###Exception:::Root cause::: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

           

          Once I add it back and restart the SMP 3.0 server I no longer get the error.  Perhaps try exporting the certificate and installing it again?  Alternatively you could export and then import the two starfield certificates and try those.

           

          Another option would be to use another OData source that does not use HTTPS such as http://services.odata.org/OData/OData.svc/Products

          See the OData appendix for more details.  Getting Started with Kapsel – Appendix A — OData

          (0) 
          1. Eugene Yew

            Thanks Daniel.

             

            I tried exporting the file again from another Chrome browser on another PC, deleting previous one, re-importing, restarting server but same message. I think there’s something different from the cert that I’m exporting somehow. Assuming you are allowed to, are you able to make available to us the cert you exported ?

            If not, which ones of the Starfield certs should we be importing alternatively, assuming they’re from the URL below ?

            https://certs.starfieldtech.com/anonymous/repository.pki

             

            PS I tried the HTTP OData source for Products and that pings OK but assume the rest of the tutorial will require the Flight endpoint.

            (0) 
            1. Daniel Van Leeuwen Post author

              Below I have included the smp_keystore.jks file that includes the certificate that was exported from

              https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/

               

              You can view it by running

               

              keytool -list -v -keystore smp_keystore.jks -alias sapgatewaycert

               

              I would shut down your SMP 3.0 server, rename the existing file at

              C:\SAP\MobilePlatform3\Server\configuration\smp_keystore.jks

              and then unzip the one from here.

               

              Restart your SMP 3.0 server by running

               

              C:\SAP\MobilePlatform3\Server\go.bat

               

              Then in the management cockpit, under Settings > Connections, select com.mycompany.logon and press the ping button.

               

              Here is the link that contains the smp_keystore.jks with the certificate from my SMP 3.0 SP02 server.  Note the link will be valid for 7 days.

               

              SAP Box Attachment

               

              Please let me know if that helps.

               

              The samples in the rest of the guide are fairly simple and very specific to the plugin or example they are showing.  Most of them do not use the OData source.  I think you could proceed without getting this step working.

               

              For the starfield certs, you could export the two shown in the image below.  Select the top one, change to the Details tab and click copy to file.  Then click the second one, change to the Details tab and click copy to file.Capture.PNG

               

              Regards,

               

              Dan van Leeuwen

              (0) 
              1. Eugene Yew

                Hi Daniel, I tried your workaround but SMP didn’t seem to like it, presumably because we would have imported the cert with different SMP server passwords ?

                I was wondering if there might be a difference in the cert file produced due to differences in browser / OS versions and I was hoping to try to import into my server the certs that work for you.

                I also noticed that I have not applied any Service Packs on my SMP server – I noticed your tutorial asks us to get SP2 for the SDK, but you haven’t listed any SP for the server itself so assume that’s not an issue ?

                I’m using another HTTP oData endpoint for now so it’s not a showstopper but would be good to be able to get pass this at some stage, thanks.

                (0) 
                1. Daniel Van Leeuwen Post author

                  The file smp_keystore.jks will have a password.  The SMP 3.0 server needs to know what the password is.  The smp_keystore.jks that I included was from an 3.0 SP 02 version of the server and has a password of changeit.

                   

                  If your SMP 3.0 server is using a different password for the keystore, you could change the password for the keystore I provided using the following command

                   

                  keytool -storepasswd -keystore smp_keystore.jks

                   

                   

                  I would recommend upgrading both the SDK and server to SP 02.

                  (0) 
                2. Ivan Mirisola

                  Eugene,

                   

                  Try installing this software to view what’s on the smp_keystore.jks file. It will also allow you to easily import any certificates based on host and port of the destination web site where the OData endpoint is without needing keytool knowledge.

                  http://sourceforge.net/projects/keystore-explorer/files/

                  Be careful while using this program – always backup the jks file before tampering with it.

                   

                  When you click on the button “Examine SSL” the app will validate the SSL connection and will allow you to import the certificates directly into SMP’s keystore.

                   

                  A common issue with certificates is that you must have all certificates in the certification path in order for SSL to work. That’s the reason why you need root certificates an intermediate certificates up-to-date according to the corresponding CAs.

                  In other words the certificate from web site in question will be invalid if you don’t have the issuer’s certificates.

                   

                  Good luck!

                  Regards,

                  Ivan

                  (0) 
  2. jitendra kansal

    Daniel Van Leeuwen

     

    I was trying to add below plugin as per below syntax. But getting error as mentioned in the screenshot.

    A plugin can be added with the following command.  The below plugin enables console.log to display log messages.
    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

    consoleError.PNG

    What i noticed is:

    As soon i run this command cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git, folder ‘1405273622733’ appears and disappears soon.

     

    I dont see folder ‘1405273622733’ under this path C:\Users\Jitendra\AppData\Local\Temp\plugman\git

    What could be the wrong?

     

    Rgrds,

    JK

    (0) 
    1. Daniel Van Leeuwen Post author

      From the error message, it sounds like it could not connect to the https://git-wip-us.apache.org.

      Perhaps you did not have internet access at the time the command was run?

      Do you use a proxy to access the internet?  If so, perhaps double check the proxy settings as shown in Installing Apache Cordova with Node.js.

      You could try adding the -d command to get additional output.

      You could try accessing it over http.

      cordova plugin -d add http://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

      or by plugin name

      cordova plugin add org.apache.cordova.console

       

      Hope that helps,

      Dan van Leeuwen

      (0) 
  3. Ranjith Lingala

    Hi All,

     

    When i configuring for kapsel application development i got following the error when the time of cordova plugin’s installation.

     

    /wp-content/uploads/2014/07/cordova_505494.jpg

    Please help me where i am in wrong.

     

    Regards,

    Ranjith Lingala

    (0) 
      1. Ranjith Lingala

        Thank you Jitendra for your quick response.

         

        I already check that one it’s working fine. Please find the below screen for more information.

         

        And then where is the problem please help me on the same.

        And i did everything whatever in above document and as well as infocenter.sybase.com, but i didn’t find out where exactly the problem for installing cordova plugin’s, if u have any step by step guide please share me.

         

        /wp-content/uploads/2014/07/cordova1_505725.jpgRegards,

        Ranjith

        (0) 
          1. Ranjith Lingala

            Hi Jitendra,

             

            We are not using any proxy server for accessing internet we are accessing internet directly without proxy server, then what i want to do for this case please help me on the same.

             

            cordova2.PNG

             

            corodova2.PNG

            Best Regards,

            Ranjith

            (0) 
            1. jitendra kansal

              Ranjith Lingala

               

              If you are not using proxy, you may remove it by running these commands:

              npm config delete proxy

              npm config delete https-proxy

              Can you confirm what is SMP 3.0 mobile SDK version you are working on?

              Make sure to install following cordova version against existing mobile SDK

               

              Cordova 3.3.1-0.1.2 (or the latest 3.3.x version) should be used if using SMP 3.0 SP02.

              Cordova 3.4.0-0.1.3 should be used if using SMP 3.0 SP03.

              Cordova 3.4.1-0.1.0 should be used if using SMP 3.0 SP04.


              e.g. npm install -g cordova@3.4.1-0.1.0 (for SMP mobile SDK 3.0 SP04)


              Rgrds,

              JK


              Note: not sure if it is correct since you were trying with only npm install -g cordova@3.4.0

              (0) 
              1. Ranjith Lingala

                Hi Jitendra,

                 

                Thanks for your quick support and that is the problem only because i am not using any proxy for internet, and i deleted using npm for both http and https proxy’s probelm will be solved.

                 

                And i have another query related to Agentry, right now i am using SMP 3.0.

                I installed both SMP 3.0 Server and SMP 3.0 SDK without any problem.

                Under SMP SDK 3.0 following are the Agentry related components.

                Agentry Components.PNG

                 

                 

                By above screen i didn’t find latest Agentry Server 7.x.x related information.

                In previous version of like SMP 2.3, whenever we installed SMP 2.3 SDK in that every components will be available with including Agentry Server 6.x.x. Please find the below screen for better understand.

                Agentry Server.PNG

                Now in SMP 3.0 SDK or SMP 3.0 Server i didn’t find anywhere latest Agentry Server 7.x.x component. Where i need to find the same. Please help me on this query.

                 

                Regards,

                Ranjith Lingala

                (0) 
  4. Ranjith Lingala

    Hi All,

     

    I am close to execute Android application using cordova plugin’s with SMP 3.0 Kapsel development,

    Now i am in end of this part like “Getting Started with Kapsel – Part 1”

     

    In that whenever i run this (cordova -d prepare android) command ” i am getting following error please find below screen.

    cordova erro when prepare command.jpg

    And after generation of the application i import the same application with my android eclipse (eclipse-SDK-3.7.2-win32-x86_64) then i run that application in emulator i am getting error in emulator like “Unfortunately, ‘appname’ has stopped”. Please find the screenshot for better understand.

    android cordova error.jpg

     

    Please find the logcat also.

     

    log cat.jpg

    So anybody help me.

     

    Thanks,

    Ranjith

    (0) 
      1. Ranjith Lingala

        Hi Jitendra,

         

        I try the same whatever you shared and application is working fine without any issue, problem is that only i am trying that command some other path now problem is solved and i understand.

         

        Thank your excellent support and response.

         

        Best Regards,

        Ranjith Lingala

        (0) 
  5. Mohan Kumar

    Hi all,

     

    I am trying to add android platform using

    cordova -d platform add android

    But i am getting the below error:

    Capture.PNG

     

    I have cross checked the path in the environment variable it is pointing to the ant bin correctly.

     

    Please let me know your inputs on the same

     

    Regards,

    Mohan

    (0) 
  6. Felix Guldner

    Hi,

    when I try to add the android platform to my cordova (3.5.0-0.2.6) project, I get the error “Please install Android target 19 (the Android newest SDK).”.

     

    When I run “android” in my command-line, I see the following version information:

    /wp-content/uploads/2014/08/sdk_manager_512477.png

    Do I have to “downgrade” my Android SDK version somehow? Or is there another problem?

    Thanks and best regards

    Felix

    (0) 
    1. Mohan Kumar

      Hi Felix,

       

      I faced the similar issue and here is what i did after googling the issue.

       

      Goto C:\Users\<user>\.cordova\lib\android\cordova\<version>\framework

       

      There is a project.properties file, change the target here to

      target=android-19 and run the command, it should work.

       

      Regards,

      Mohan

      (0) 
  7. Eli Mizrahi

    Hi

     

    I’m trying to download The 3.0 SP04 SDK, and the 3.0 SP03 server and 3.0 SP03 PL02 patch for the server through the SAP Service Market Place as mentioned on this document but i can’t find the files.

     

    I ended up with this link that have the a download links (not hte latest version):

    Download and install Mobile SDK 3.0

     

    But it doesn’t include the server download links.

     

    Can you refer me to the right download links?

    (0) 
      1. Eli Mizrahi

        Hi

        i navigated to the link you posted.

        Clicked on M.

        Didn’t found “SAP Mobile platform”, instead i navigated to “Sap Mobile Solutions” > “SAP Mobile Platform”.


        No “SAP Mobile Platform SDK” found there, please see screenshots/wp-content/uploads/2014/08/list_522762.png.


        /wp-content/uploads/2014/08/list2_522763.png

        (0) 
          1. Eli Mizrahi

            Hi

            Got the right user for download the SMP3.

            Should i download the “SAP MOBILE PLATFORM 3.0”?

            What about the SDK and the server?

            Maybe i don’t see them cause of a SMP license issue?

            this is the screenshot

            /wp-content/uploads/2014/08/list_522877.png

            (0) 
            1. Midhun VP

              Hi Eli,

               

              You will find SMP SDK and SMP runtime under “M”. The screen shot that you given is SMP runtime (server).

               

              Regards,

              Midhun VP

              (0) 
  8. avinash kumar

    I am using SMP SDK 3.0 SP05  with Cordova 3.5.0-0.2.7  and getting error while fetching dependent plugins using logon. Please assist me. Thank You

    ScreenHunter_05 Nov. 07 01.22.jpg

    (0) 
    1. Daniel Van Leeuwen Post author

      I would try deleting your project and recreating it.  When you create your project be sure to add the plugin_search_path parameter.  It is this parameter that tells plugman where to locate the com.sap.mp.cordova.plugins.corelibs plugin.

       

      For example

       

      cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo “{\”plugin_search_path\”:\”C:/SAP/MobileSDK3/KapselSDK/plugins/\”}”

      (0) 
      1. avinash kumar

        Hi Daniel,

        Since I upgraded to SP05 from SP03 and also server, SAPUI5 files don’t seem to be loading. This is what I got on console while debugging. Is there any reason and how can I rectify it.. Thank You


        IAB close, NO_WINDOW Utils.js:4

        processMessage failed: Error: Error: found in negative cache: ‘sap/ui/model/odata/ODataModel.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataModel.js: Error: found in negative cache: ‘sap/ui/model/odata/ODataUtils.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataUtils.js: Error: found in negative cache: ‘sap/ui/model/odata/Filter.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/Filter.js: Error: found in negative cache: ‘sap/ui/model/Filter.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/Filter.js: Error: found in negative cache: ‘sap/ui/model/FilterOperator.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/FilterOperator.js: TypeError: Cannot call method ‘getObject’ of undefined cordova.js:1044

        processMessage failed: Stack: Error: found in negative cache: ‘sap/ui/model/odata/ODataModel.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataModel.js: Error: found in negative cache: ‘sap/ui/model/odata/ODataUtils.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataUtils.js: Error: found in negative cache: ‘sap/ui/model/odata/Filter.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/Filter.js: Error: found in negative cache: ‘sap/ui/model/Filter.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/Filter.js: Error: found in negative cache: ‘sap/ui/model/FilterOperator.js’ from resources/sap/ui/core/library-preload.json/sap/ui/model/FilterOperator.js: TypeError: Cannot call method ‘getObject’ of undefined



        (0) 
        1. Daniel Van Leeuwen Post author

          I have not seen that error before.  Are you encountering the error when following a specific example from this guide or is this in your own custom app? 

           

          There are a few hits if you Google for “Found in negative cache”

          (0) 
    2. Pratha Rasappan

      When I added the plugin first and then created the android platform, this error occurred. But when created android platform and then added the plugin. Worked just fine!

      (0) 
  9. Davinder Singh

    Hi,

    Can someone please share a sample iOs app in which Push Notifications are working?

    Better if the app is integrated with SMP Server (SP04 or later).

     

    My configurations are done on the SMP side, but i don’t know how to use the Push Plugin from Javascript side.

    As in how should i use the Javascript API to get the APNS token and how this token is sent to the SMP Server during registration?

    I am trying a fiori client application.

    Thanks and appreciate your help.

     

    Regards,

    Davinder

    (0) 
  10. Ivan Mirisola

    Daniel,

     

    A good tip is also stated on note “2036005 – Failed to install ‘com.sap.mp.cordova.plugins.logon’ errors while building SMP 3.0 SP03 Kapsel applications for iOS or Android”.

     

    While adding SAP plugins to a Cordova project I faced an issue where I had to install each dependency one-by-one according to the error message. Apparently, by doing a “git init” this will solve the problem.

     

    BR,

    Ivan

    (0) 
    1. Daniel Van Leeuwen Post author

      As of SP04 of the SDK, Kapsel plugins are now resolved using the plugin_search_path as shown below.

       

      cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo “{\”plugin_search_path\”:\”C:/SAP/MobileSDK3/KapselSDK/plugins/\”}”

       

      So as of SP04 of the SDK, the git init workaround should no longer be needed.

      (0) 
  11. Ivan Mirisola

    Daniel,

     

    Where did you find the information regarding compatibility between Cordova and SKD versions? I cannot find an SAP Note that could clearly state the relationship between Cordova and SDK versions.

     

    BR,

    Ivan

    (0) 
    1. avinash kumar

      Hi Ivan,

      Getting Started with Kapsel – Appendix E — Upgrading

       

      This might help you to check with cordova version compatible to SMP 3.0 SP03 Kapsel

       

      Cordova 3.0.6/3.0.9 -> SMP SDK 3.0

      Cordova 3.1.0-0.2.0 -> SMP SDK 3.0 SP01

      Cordova 3.3.1-0.1.2 -> SMP SDK 3.0 SP02

      Cordova 3.4.0-0.1.3 -> SMP SDK 3.0 SP03

      Cordova 3.4.1-0.1.0 -> SMP SDK 3.0 SP04

      Cordova 3.5.0-0.2.7 -> SMP SDK 3.0 SP05


      It helped me to get solution. Try this


      Avinash

      (0) 
    2. Daniel Van Leeuwen Post author

      I try to keep this information up to date in this document in the location mentioned by Avinash or on this page under the section titled “Installing Apache Cordova with Node.js”.

       

      The public documentation would be another location to find this information.

       

      See the section named “Installing the Apache Cordova Command Line Interface” at

       

      http://help.sap.com/saphelp_smp305sdk/helpdata/en/7c/1ccdde70061014b797c287b94d60cc/content.htm

      (0) 
      1. avinash kumar

        Hi Daniel,

         

        The code was working fine until I got this problem it says

         

        Error:

        CordovaLog(26008): file:///android_asset/www/js/index.js: Line 41 : Uncaught TypeError: Cannot call method ‘querySelector’ of null

         

        I tried putting index.js at different places before and after jquery.

        <script type=”text/javascript” src=”cordova.js”></script>

        <script type=”text/javascript” src=”js/index.js”></script>


        It seems (“deviceready”, init, false) event is not fired.


        Can you suggest me if am wrong.

        (0) 
  12. Marius Stoica

    Hi Daniel,

     

    Great document, I use it allot .

     

    I have an issue (described also in here SAPUI5 – Context transfer ).

     

    I’m trying to push 2 models to the same page, and some suggested that I might need some routing in my app.

     

    I tried using OpenUI5 SDK – Demo Kit with little to no success. If this:

     

    sap.ui.app.Application.extend(“Application”, {

      metadata : {

      routing : {

      config : {

      viewType:”JS”,

      viewPath:”view”,

      targetControl:”navContainer”,

      targetAggregation:”pages”,

      clearTarget : false

      },

      routes : [

               {

               pattern : “”,

               name:”HomePage”,

               view:”HomePage”

               },

               {

               pattern : “”,

               name : “Order”,

               view : “Order”

               }]

      }

      },

     

    Doesn’t generate an error (since I saw this used with a shell app and sap.ui.core.UIComponent.extend) when I try to initialize the router, I get an error:

     

    processMessage failed: Error: TypeError: Object [object Object] has no method ‘getRouter’

    using this in the same sap.ui.app.Application.extend(“Application”):

    init : function() {

      var router = this.getRouter();

      this.routeHandler = new sap.m.routing.RouteMatchedHandler(router);

      router.initialize();

    },

     

    Any idea what should I do ?

     

    Thanks,

    Marius

    (0) 
  13. Claudio Quaglia

    But for windows 8.1 application it need something more? Because i have lot of problem with logon plugin.

     

    once is this after call sap.Logon.init

     

    Unhandled exception at line 100, column 33 in ms-appx-web://ae570560-9b13-11e4-aa30-7ff15e6cad23/www/smp/logon/ui/resources/sap-ui-core-nojQuery.js

    0x800a139e – JavaScript runtime error: failed to load ‘sap/ui/thirdparty/jquery-mobile-custom.js’ from resources/sap/ui/thirdparty/jquery-mobile-custom.js: ReferenceError: ‘MSApp’ is undefined

    (0) 
    1. Daniel Van Leeuwen Post author
      (0) 
  14. saurabh shrivastava

    Hi Daniel,

     

    i am creating a project using command line tool then importing in the android  IDE. but i am getting error like Android requires compiler compliance level 5.0 or 6.0. Found ‘1.4’ instead. after changing compiler to 1.6 i am still facing error like

    /demo/gen already exists but is not a source folder. Convert to a source folder or rename it.

     

    i tried all possible option but don’t know how to resolve it.

    BR,

    saurabh

    (0) 
  15. Miguel Navarro

    hi,

    while i am trying to install the SAP HAT using the kapsel SDK  , i am gettin the error as below . It is saying “config” file is not specified and while adding plugins toolbar is not available .But when i checked in the respective file location both the files exists.

     

    ERROR:

    The build script exited unexpectedly!

     

    No config file specified. Searching for config.json in the current directory. Config file found at c:\SAP_HAT\WebIdeCompanion\companionapp/config.json. platforms: android Creating WebIdeCompanion project. Creating a new cordova project with name “WebIdeCompanion” and id “com.sap.ide.companion” at location “c:\SAP_HAT\WebIdeCompanion\companionapp\CompanionApp” Using custom www assets from c:\SAP_HAT\WebIdeCompanion\companionapp\assets\www c:\SAP_HAT\WebIdeCompanion\companionapp\CompanionApp c:\SAP_HAT\WebIdeCompanion\companionapp Adding platforms… android Creating android project… Creating Cordova project for the Android platform: Path: platforms\android Package: com.sap.ide.companion Name: WebIdeCompanion Android target: android-19 Copying template files… Project successfully created. Adding CompanionApp plugins… Fetching plugin “..\plugins/toolbar” via plugin registry npm ERR! addLocal Could not install ..\plugins/toolbar Error: ENOENT, open ‘c:\SAP_HAT\WebIdeCompanion\companionapp\plugins\toolbar\package.json’ cmd error The node process of the build script exited with code 1.

     

    help please…

    (0) 
    1. Daniel Van Leeuwen Post author

      It would be best to post this question as a new discussion or perhaps at SAP Web IDE Hybrid App Toolkit Add-on

       

      This guide does not cover the Hybrid Application Toolkit.

       

      The one thing I would suggest though is to verify the version of the Mobile SDK being used.  I imagine that a version of the Hybrid Application Toolkit is designed to work with a certain version of the Mobile SDK.

       

      Regards,

       

      Dan van Leeuwen

      (0) 
  16. Dan Antonio

    This series of articles has proved to be invaluable in the actual implementation of the SAP Mobile Platform Kapsel solutions.  I definitely get more from this than from any of the documentation.  Thanks so much!

    (0) 

Leave a Reply