Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 

1. Create the Connection at HCP a

2. Create the Connection at HCC if you use the HCC a

3. Prepare your Application at the HCPms a

4. Get an SAP Mobile Secure Account a

5. Create an Android Signing ID a

6. Get you SAP Mobile Secure Cloudusername and password a

7. Download the packager

8. Prepare the appconfig

9. Package the App

10. Create the Cordova App

11. Download it from your SAP Mobile Secure Account and run it

7. Download the packager


Prerequisite: you have installed npm, node.js.

In this particular case I have: npm version 2.7.4, node version v0.12.2.

Download the latest version of the packager which is included in the Kapsel SDK

https://help.hana.ondemand.com/webide_hat/frameset.htm?d2865598e67f4ddabc79e5943352b0a1.html

Unzip this to a folder. The final folder should look like here:

Create a folder when you will execute the packager (here: PackagedApp).

The sources will be downloaded to it and the app will be generated.

8. Prepare the appconfig

Copy the appConfig.js file to your work directory (example folder “PackagesApp”)

(I've attached my appconfig to this blog)

Adapt it:

Enter the appID and appName which you define at step 3

Enter your SigningID(step 5)

Your HCPms URL

Choose which Apps you want to download

[…]

fiori_client_appConfig = {

    "appID": "com.sap.mycontact",

    "appName": "MyContacts",

    "appVersion": "0.1",

    "bundleID": "com.sap.mycontact",

    "androidSigningID": "b6XXXXXXXXXXXXXXc8",

[..]

"fioriURL": "https://hcpms-<yourD-User>trial.hanatrial.ondemand.com",

"fioriURLIsSMP": true,

"certificate": "",

"autoSelectSingleCert": false,

"passcodePolicy":  {

        "expirationDays":"0",

        "hasDigits":"false",

        "hasLowerCaseLetters":"false",

        "hasSpecialLetters":"false",

        "hasUpperCaseLetters":"false",

        "defaultAllowed":"true",

        "lockTimeout":"300",

        "minLength":"8",

        "minUniqueChars":"0",

        "retryLimit":"10"

    },

"prepackaged" : true,

"offline": true,

"singleApp" : "",

    "applications": [{

                    "id": "cus.crm.mycontacts",

                    "intent": "ContactPerson-MyContacts",

                    "title": "My Contacts",

                    "url": "/sap/bc/ui5_ui5/sap/crm_mycont"

                    }, {

      "id": "cus.crm.myaccounts",

                    "intent": "Account-MyAccounts",

                    "title": "My Accounts",

                    "url": "/sap/bc/ui5_ui5/sap/crm_myaccounts"

                    }, {

                    "id": "sap.cus.crm.lib.reuse",

                    "url": "/sap/bc/ui5_ui5/sap/crm_lib_reuse/sap/cus/crm/lib/reuse",

                    "reuse": true,

                    "scenario": true

                    }]

};

[..]

Your folder structure might look like this:

Open terminal and do following commands to prepare the packager:

cd H:\Desktop\FioriApps\CRM\smp-plugins\apps\packager



Run the following commands (If this is your first use with this packager version):

npm install

npm config set proxy <protocol>:://<proxyhost>:<proxyport>

npm config set https-proxy <protocol>:://<proxyhost>:<proxyport>


9. Package the App

Do following commands to create a package.

This will download the sources (sapui5 and application) from the given server

Note: On mac the packager will need executable permissions which can be added by running with the bin directory: sudo chmod 755 packager

cd H:\Desktop\FioriApps\CRM\PackagedApp

node ../smp-plugins/apps/packager/bin/packager --config appConfig.js --targetDir CRM --host cimg1.wdf.sap.corp --port 50081 --https --force --cleanAppCache --user <CRM-username> --password <CRM-password>

Now you should have downloaded sources with the applications and sapui5. This should be your folder structure

With this structure you can create a cordova app.

10. Create the Cordova App

http://help.sap.com/saphelp_smp3010sdkmfadev/helpdata/en/ca/b7a87eba614c6b84f70bb9f0bfd59d/content.h...

This command creates a package, reading for uploading and building, on the cloud build server.

node ../smp-plugins/apps/packager/bin/packager --config appConfig.js --targetDir CRM --cloudHost portal.next.sapmobilesecure.com --cloudUser <yoursapmobilesecureuser> --cloudPassword <yoursapmobilesecurepassword> --cloudProxy proxy.wdf.sap.corp:8080 createpackage

This command uploads the assets that have been downloaded from the Fiori front-end server to the cloud build server, including the splash screen definitions and icons that represent the application on the device home screen.

node ../smp-plugins/apps/packager/bin/packager --config appConfig.js --targetDir CRM --cloudHost portal.next.sapmobilesecure.com --cloudUser <yoursapmobilesecureuser> --cloudPassword <yoursapmobilesecurepassword> --cloudProxy proxy.wdf.sap.corp:8080 uploadpackage

This command initiates the build on the SAP Mobile Secure cloud build server.

node ../smp-plugins/apps/packager/bin/packager --config appConfig.js --targetDir CRM --cloudHost portal.next.sapmobilesecure.com --cloudUser <yoursapmobilesecureuser> --cloudPassword <yoursapmobilesecurepassword> --cloudProxy proxy.wdf.sap.corp:8080 startbuild

Use this command during a build to check the build status.

node ../smp-plugins/apps/packager/bin/packager --config appConfig.js --targetDir CRM --cloudHost portal.next.sapmobilesecure.com --cloudUser <yoursapmobilesecureuser> --cloudPassword <yoursapmobilesecurepassword> --cloudProxy proxy.wdf.sap.corp:8080 status

11. Download it from your SAP Mobile Secure Account and run it

After this your app will be created and you will be notified via e-mail. You can download this app directly using the link in the e-mail.

After the Installing open the App, enter your Fiori Username and Password.

Have fun with you offline app :smile:

Note: In the packaged app after store initialization the Launchpad is shown but the apps are not displayed? Go to your downloaded App folder (here: H:\Desktop\FioriApps\CRM\PackagedApp) and in the ushellconfig.js change "isDefault: false" to "isDefaultGroup: true".