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,769
Create Android application based on sapui5 project

Download and install Node.js from https://nodejs.org/en/download/

  • Run the installer and follow the prompts in the Install wizard.

  • On completion, verify that the Node.js folder is in your system environment path.


Open a command prompt, and enter npm to verify the Node.js package manager is available. After that, the terminal window displays the help file for npm. If you do not see this, and see an error message instead, it indicates the node installation did not complete successfully. You may need to reboot the system to see the changes, or you may need to reinstall Node.js.
Download and install the latest Java Development Toolkit (JDK) from http://www.oracle.com/technetwork/java/javase/downloads/index.html .

It is required for generating certificates during installation, which allow a secure connection to be setup between your browser and the local tooling environment.

  • Follow the installer to install the package.

  • Create a JAVA_HOME environment variable in the .bash_profile with this line (for Mac OSX 10.5 or later):


export JAVA_HOME=$(/usr/libexec/java_home)

For an older Mac OSX, /usr/libexec/java_home does not exist. You should set the JAVA_HOME to a fixed path such as:

export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home

               For Window search “Path” and open “Environment Variables” dialog. After that find in “System variables” JAVA_HOME variable and make sure it has the right path. If it doesn’t exist create a new one.

Download and install Cordova via npm

Create the App 
$ cordova create < Path to your new Cordova Android project> < Package name, following reverse-domain style convention> < Main Activity name>

  • E.g. $ cordova create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName


Add android platform
Go to newly created folder with project and run

  • $ cordova platform add android –save


Move source sapui5 code to cordova project

  • Copy files from sapui5 project (files from folder webapp)

  • Download “resources” folder with SAPUI5 core files from nexus https://nexus.wdf.sap.corp:8443/nexus/service/local/repositories/deploy.releases/content/com/sap/ui5... and extract zip archive. NOTE: this link accessible only in SAP-corporate network. OpenUI5 library is open source.

  • Go to “www” folder in your cordova project and remove all from there

  • Move webapp (from downloaded) and resources (from extracted in previous step zip archive) to “www” folder


 Set system and client configuration

  • Open <your project folder>/www/webapp/ and set direct service paths (without proxy).


Build the App

  • Go to project folder and execute $ cordova build android

  • After success build .apk file will be available in <your project folder>/platforms/android/build/output/apk/android-debug.apk


Upload android-debug.apk file to Android device

 

Create IOS application based on sapui5 project

 Download and install Node.js from https://nodejs.org/en/download/

  • Run the installer and follow the prompts in the Install wizard.

  • On completion, verify that the Node.js folder is in your system environment path.


Open a command prompt, and enter npm to verify the Node.js package manager is available. After you issue this command, the terminal window displays the help file for npm. If you do not see this, and see an error message instead, it indicates the node installation did not complete successfully. You may need to reboot the system to see the changes, or you may need to reinstall Node.js.

Install Xcode

  • Follow the instructions from cordova guide:      


https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

Download and install Cordova via npm

C:\> npm install -g cordova ( https://cordova.apache.org/docs/en/latest/guide/cli/

Create the App
$ cordova create < Path to your new Cordova IOS project> < Package name, following reverse-domain style convention> < Main Activity name>

  • E.g. $ cordova create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName


Add ios platform
Go to newly created folder with project and run

  • $ cordova platform add ios --save


Move source sapui5 code to cordova project

 Set system and client configuration

  • Open <your project folder>/www/webapp/ and set direct service paths (without proxy). 


Build the App

  • Go to project folder and execute $ cordova build ios

  • After success build .xcodeproj will be available in <your project folder>/platforms/ios/<projectName>.xcodeproj


Create IOS account and provisioning profile (if it’s not exist)

There are two different account type in Apple dev environment:

  • Developer account (Allows to distribute via appstore or install on a device (Ad-Hoc distribution). Has 100 device limit + required device registration before installation). More details: https://developer.apple.com/programs/

  • Enterprise account (Allows to distribute the app inside the corporate without device registration. Has no device limit.) More details: https://developer.apple.com/programs/enterprise/

  • After the required program is purchased please login to https://developer.apple.com, select Account tab and then Certificate, Identifiers & Profiles.




Create IPA file from Xcode project

  • First step is to make sure you have “iOS Device” selected for the target – don’t have your device plugged in! Then select Product > Archive from the menu.

  • The Organizer window will open showing your app. Click the “Export…” button and you will be prompted for an export method. Choose “Save for Ad Hoc Deployment” or “Save for enterprise Deployment”.

  • You’ll be prompted to select your Apple Developer Portal team and confirm the Export. If you have created and installed a Provisioning Profile it should find your Profile and Certificate.

  • Select “Export one app for all compatible devices” on “Device support” window

  • The IPA file is ready for upload.


Install the app on device via itunes.

Best Regards,
Aleksandr.
2 Comments