Create a Local Cordova Project

Generate a Cordova application package for iOS and Android.

Prerequisites
Apache Cordova ships with a set of command-line tools you can use to create, build, and launch an emulator with a single command.  AppBuilder supports the command-line tools to create Cordova projects. AppBuilder generates a ZIP file that contains the Web content for Cordova, as well as scripts to create the Cordova project and add SAP Mobile Platform SDK Kapsel plug-ins. Prior to creating your Cordova project, you must:
  • Set up your Cordova environment following the steps in Setting Up the Development Environment > Developing with Cordova
  • If developing on a Mac, set up your Mac environment following the steps in Setting Up the Development Environment > Setting Up the Mac Environment.
  • Set up your Android development environment following the steps in Setting Up the Development Environment > Developing for the Android Platform.
  • Create an AppBuilder project as discussed in Developing Apps with AppBuilder, Developing a SuperList App With AppBuilder, and Developing a Chart App With AppBuilder.
  • Register your application with SAP Mobile Platform Server using the SAP Management Cockpit administration user interface. See the SAP Mobile Platform documentation for more information.
Task
  1. Open the application you wish to use to create your Cordova project.
  2. Configure the WorkSpace Settings. The WorkSpace is the local folder where your Cordova project will be generated:
    1. In the AppBuilder menu, select Deployments > Workspace Settings.
    2. In the Kapsel Deployment Workspace dialog, enter a valid local folder name as shown:
      workspace_settings
    3. Click Confirm to save your settings and close the dialog.
  3. In the AppBuilder menu, select Deployment > Create Cordova Project. This will open the Deployment Settings dialog:
    deployment_settings
    • Application name – the name of the application.
    • Application ID – If you are using a SAP Mobile Platform data source or Kapsel plug-ins in the application, this must match the SAP Mobile Platform settings.

      If you are not using any SAP Mobile Platform or Kapsel plug-ins, this can be any application ID that is valid for Cordova.

    • (Optional) Application description – a description for your application.
    • Application version – this is the same as the version in project settings.
    • Deployment – you can choose one or both platforms.
      • For iOS – if you select this, an iOS settings tab is shown, in which you can choose iOS specific settings.
      • For Android – if you select this, an Androd settings tab is shown in which you can choose Android specific settings.
    • Application icon – choose the icon for the application. AppBuilder provides some default icons in the /res/icon folder in the Project Explorer for the sample applications that are included. You can upload your own icons as .png files by clicking File > Upload File in the AppBuilder menu.
  4. Click Native Plugins to add plugins to your device:
    1. Click the Cordova tab to select the Cordova plugins you would like to include in your project:
      1. Enter the path to the Cordova plugins. Leave this field blank if you are using the global Cordova path.
      2. Click the checkbox(es) next to the plugin(s) you with to use in your project.
    2. Click the Kapsel tab to select the Kapsel SDK plugins you would like to include in your project
      1. Enter the path to the Kapsel SDK plugins. On Windows, the Kapsel plugins are located in the \KapselSDK\plugins folder in the MobileSDK3 install directory. For example, if SAP Mobile Platform SDK is installed in C:\SAP, then the KapselSDK plugin path is C:\SAP\MobileSDK3\KapselSDK\plugins. On Mac, the Kapsel plugins are located in the directory the MobileSDK.zip file is extracted. For example, if the MobileSDK.zip is extracted to %HOME%/MobileSDK3, the Kapsel plugin path would be /Users/<logon user>/MobileSDK3/KapselSDK/plugins.
      2. Click the checkbox(es) next to the plugin(s) you wish to use in your project.
    3. (Optional) Click the Other Plugins tab to enter plugin paths for other 3rd party plugins you wish to use in your project.
      1. Click the + add the plugin path to be used in your project. You can add additional plugins, remove plugins, or change the order of the plugins list using the navigation buttons to the right of the plugin path field.
  5. (Optional) Click the iOS tab to configure the iOS device simulator settings. This option will be available if you selected the For iOS checkbox in the Application tab.

    iOS_settings

    Select your desired settings and icons for the application.

  6. (Optional) Click the Android tab to configure the Android device simulator settings. This option will be available if you selected the For Android checkbox in the Application tab.

    Android_settings

    Select your desired settings and icons for the application.

  7. Click Confirm to save your settings and create your project. AppBuilder creates the local Cordova project in the Workspace setting folder you specified in Step 2.
Related tasks
Deploying a Kapsel App on SAP Mobile Platform Server
Launch to Simulator
Related reference
Setting Up the Development Environment