Chapter 6. Importing Client Apps and Cloud Apps into Projects

Overview

You can import existing Client Apps and Cloud Apps into projects. A git repository is created in RHMAP for each imported app.

The imported apps must fulfill the requirements outlined in this document:

Requirements

  • Cloning, pushing, or pulling from Git repositories hosted in RHMAP requires an SSH key to be configured in the platform.

6.1. Creating an Empty Project

This guide assumes that you do not currently have a project in Studio. To create a bare project:

  1. Log in to the Studio.
  2. Navigate to Projects.
  3. Click + New Project.
  4. Select the Empty Project template and give the new project a name.
  5. Click Create button.
  6. When the project has been created, click Finish.

6.2. Importing a Client App

Before creating a Client App, make sure there is at least one Cloud App already created in the project. See Importing a Cloud App to import an existing Cloud App.

  1. In your bare project, navigate to Apps, Cloud Apps & Services.
  2. Click the + in the Apps box.
  3. Click Import Existing App.
  4. Select the App Type you wish to create. See Client App Requirements to make sure your app can be imported.
  5. Click Next and give your imported app a name.
  6. Choose how to import the app.

    • Public Git Repository

      Enter the URL of a public Git repository containing the Client App, and a branch name. The default is master.

    • Zip File

      On your computer, create a single ZIP archive of the contents of your Client App.

      zip -r app.zip ./ -x *.git*

      In Studio, choose the ZIP file to upload.

    • Bare Repo

      This creates an empty repository where you can push your app code.

  7. Click Import & move on to Integration. Your Client App is imported into the project.

    If you imported using the Bare Repo option, click Already have a git repo and follow the presented steps.

    If you imported using the Zip File or Bare Repo options, you will be presented with steps for integration of the RHMAP SDK.

  8. Click Finished - Take me to My App!.

6.3. Importing a Cloud App

  1. In your bare project, navigate to Apps, Cloud Apps & Services.
  2. Click the + in the Cloud Code Apps box.
  3. Click Import Existing App.
  4. Select the App Type you wish to create. See Cloud App Requirements to make sure your app can be imported.
  5. Click Next and give your imported app a name.
  6. Choose an initial deployment environment.

    Your Cloud App will be deployed to the chosen environment immediately after importing. Choose None to skip the initial deployment.

  7. Choose how to import the app.

    • Public Git Repository

      Enter the URL of a public Git repository containing the Cloud App, and a branch name. The default is master.

    • Zip File

      On your computer, create a single ZIP archive of the contents of your Cloud App.

      zip -r app.zip ./ -x *.git*

      In Studio, choose the ZIP file to upload.

    • Bare Repo

      This creates an empty repository where you can push your app code.

  8. Click Import & move on to Integration. Your Cloud App is imported into the project.

    If you imported using the Bare Repo option, click Already have a git repo and follow the presented steps.

  9. Click Finished - Take me to My App!.

6.4. Client App Requirements

Prerequisites for importing a Client App into your project depend on the type of Client App you are creating.

6.4.1. Cordova App

A standard Cordova 3.x mobile application. These apps consist of a combination of web technology and native code. The underlying native project and Cordova libraries are exposed to the developer allowing for full customization or the app, including Cordova plug-ins and third-party SDKs.

Typically, the amount of time spent writing or modifying native code for these apps is relatively small and requires only a small development team to have experience with native code. They should be able to develop, configure, and manage the native code and expose any additional plug-ins or SDKs to the web layer using the standard Cordova plug-in approach.

The majority of the development team do not need to concern themselves with the native code. They can continue to develop using pure web tech, but still be in a position to take advantage of any additional functionality that has been exposed from the native layer.

Requirements

  • Minimum supported PhoneGap version: 3.0
  • Must conform to PhoneGap 3.x standard structure and contain the following files/folders:

    • www/index.html
    • www/config.xml
    • platforms/
    • plugins/
    • merges/
    • .cordova/

6.4.2. Web App

A Node.js + Express web application. These apps provide advanced mobile websites and desktop browser web portals. They expose the full power of Node.js for web app development, including functionality such as server side templating (using template engines such as Jade). They also support static file serving for standard HTML5, CSS, and JavaScript.

Requirements

  • Must be a Node.js app, with the following files located in /:

    • package.json
    • application.js - script that starts when the Node.js app is deployed
  • Your app should listen on a port specified via the FH_PORT environment variable, for example,

    app.listen(process.env.FH_PORT)

6.4.3. Native Android

A native Android app.

Requirements

  • Must be a valid Android project based on Ant or Gradle (created in Android Studio based on Eclipse or IDEA). Ant-based projects must contain an AndroidManifest.xml file in / (project root).
  • Minimum Android platform version: 2.3 (API Level 9).
  • All dependencies must be available either in the Android SDK or in Maven repositories accessible from RHMAP.

6.4.4. Native iOS

A native iOS Application.

Requirements

  • Must be a valid Xcode Project that builds and compiles correctly locally.
  • Minimum iOS OS target version: 7.0.

6.4.5. Native Windows Phone 8

A native Windows Phone 8 app.

Requirements

  • Must be a valid Windows Phone 8 project, created with Visual Studio 2012 Express.
  • Windows Phone SDK version must be Windows Phone 8+.

6.4.6. Xamarin

A Xamarin app.

Requirements

Must be a valid Xamarin solution, created either with Xamarin Studio or Visual Studio.

6.5. Cloud App Requirements

  • Must be a Node.js application, with the following files are located in /

    • package.json
    • application.js - script that starts when the Node.js app is deployed
  • Your app should listen on a port specified via the FH_PORT environment variable, for example,

    app.listen(process.env.FH_PORT)