Setting Up the Development Environment

To build Kapsel applications, you must first set up your development environment, which includes installing both SAP Mobile Platform Server, and the SAP Mobile Platform SDK.

Prerequisites

See http://service.sap.com/pam to verify that you are using the supported versions for the Kapsel development environment.

Android Requirements

Android tools run on Windows, Linux, and OS X. To build Kapsel apps for Android, you need:

See the Apache Cordova documentation at http://cordova.apache.org/docs/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide for more information about getting started with Android.

Installing the Java SDK

See http://www.oracle.com/technetwork/java/javase/downloads/index.html.

After installing the Java SDK, define the JAVA_HOME environment variable.

Download the Plugins

Set up the Android Development Environment by downloading the required plugins.

Prerequisites:
  1. Start the Eclipse environment.
  2. From the Help menu, select Install New Software.
  3. Click Add.
  4. In the Add Repository dialog, enter a name for the new plugin.
  5. Enter one of the following for URL:
    • https://dl-ssl.google.com/android/eclipse/
    • http://dl-ssl.google.com/android/eclipse/
  6. Click OK.
  7. Select Developer Tools and click Next.
  8. Review the tools to be downloaded.
  9. Click Next.
  10. Read and accept the license agreement and click Finish.
  11. Once the installation is complete, restart Eclipse.

Installing the ADT Plugin

Follow the instructions for installing the ADT Plugin for Eclipse at http://developer.android.com/sdk/installing/installing-adt.html.

If you prefer to work in an IDE other than Eclipse, you do not need to install Eclipse or ADT. You can simply use the Android SDK tools to build and debug your application.

Installing the Google USB Driver

The Google USB Driver for Windows is as an optional SDK component you need only if you are developing on Windows and want to connect a Google Android-powered device (such as a Nexus 7) to your development environment over USB.

Download the Google USB driver package from http://developer.android.com/sdk/win-usb.html.

Installing the Android SDK

Install the Android SDK for plugin use with your IDE.

  1. Confirm that your system meets the requirements at http://developer.android.com/sdk/requirements.html.
  2. Download and install the supported version of the Android SDK starter package.
  3. Add the Android SDK to your PATH environment variable:

    On Windows, add <Android SDK Location>\tools to the PATH environment variable

    On OS X, the command is: export PATH=$PATH:<path to Android SDK>/tools

  4. Launch the Android SDK Manager and install the Android tools (SDK Tools and SDK Platform-tools) and the Android API.
  5. Launch the Android Virtual Device Manager, and create an Android virtual device to use as your emulator.
    Note: (For offline applications only) Due to limitation on the emulator, you cannot determine the network connection state. For more information on other limitations, see Emulator Limitations in http://developer.android.com/tools/devices/emulator.html#limitations at the Android Developer Web site.

iOS Requirements

To build Kapsel apps for iOS, you need:

See the Apache Cordova documentation at http://cordova.apache.org/docs/en/3.0.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide for more information about getting started with iOS.

Downloading the Xcode IDE

Download and install Xcode from the Apple Developers Web site.

  1. Go to http://developer.apple.com/downloads/.
    Note: You must be a paying member of the iOS Developer Program. Free members cannot download the supported version.
  2. Log in using your Apple Developer credentials.
  3. (Optional) To narrow the search scope, unselect all Categories except Developer Tools.
  4. Download the appropriate Xcode and SDK combination.

Installing Git

See http://git-scm.com/book/en/Getting-Started-Installing-Git.

Note: If you are using a proxy server you must configure git.
git config --global http.proxy http://proxy:8080 
 git config --global https.proxy http://proxy:8080 

Installing Node.js

Use Node.js v0.10.11 and later, and its package manager, npm, to install Apache Cordova. See http://nodejs.org/. You can see the version installed by using the node command: node –v.

You must add the Node.js folder to your system PATH.

Note: If you are using a proxy server you must configure npm. At the command prompt, enter:
npm config set proxy  http://proxy_host:port 
npm config set https-proxy http://proxy_host:port

Installing the Apache Cordova Command Line Interface

See http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface. Follow all of the steps in the Cordova command line interface readme.md.

  1. Open a command prompt window, and enter:

    On Windows: npm install -g cordova@<latest_supported_version>

    On Mac: sudo npm install -g cordova@<latest_supported_version>

    For example, to install the Cordova command line interface version 3.0.9, enter:

    npm install -g cordova@3.0.9

    -g indicates that Apache Cordova should be installed globally.

    Note: If you are installing on Mac and you see a warning message that you are installing globally into a root-only directory, run this command to change the owner of the command line interface installation folder:

    sudo chown -R user_name /usr/local/lib/node_modules/cordova

    You can copy the command text from the error message and paste it in at the command prompt at the bottom of the terminal window.

  2. On Mac, when prompted, enter your root user password.
  3. Verify the Cordova installation by entering this command at the command prompt, or in the terminal window:cordova –v

    The output shows the Cordova version installed, for example, 3.0.9.

    You should also scroll back through the entire installation history shown in the terminal and look for errors to verify the installation was successful.

Installing ios-sim

To allow the Cordova command line to start the iOS simulator on Mac, you must install ios-sim.

  1. Download the ios-sim tool files from https://github.com/phonegap/ios-sim.
  2. Open a terminal window, and enter: sudo npm install -g ios-sim
  3. When prompted, enter your root user password.
  4. Verify the ios-sim installation by entering this command in the terminal window: ios-sim --version

    The output shows the ios-sim version installed, for example, 1.8.2.

Related tasks
Creating an Apache Cordova Project
Adding the AppUpdate Plugin
Adding the Logon Plugin
Adding the AuthProxy Plugin
Adding the Logger Plugin
Adding the Push Notification Plugin
Adding the EncryptedStorage Plugin
Adding the Settings Plugin