Including a Prepackaged Hybrid App in the Android Hybrid Web Container

Run a prepackaged Hybrid App so that the Hybrid Web Container functions as a single-purpose application rather than a general purpose one.

  1. Package the Hybrid App files.
    You can use a Hybrid App that was generated with the Hybrid App Designer, or you can use the packaging tool to generate a new Hybrid App.
    When packaging the Hybrid App, optimize the size by generating a version for each specific platform that includes only files for that platform.
    See Packaging Hybrid Apps Using the Packaging Tool.
  2. Copy the Generated Hybrid App folder under the package tool workspace, or copy the Generated Hybrid App folder under the SAP Mobile WorkSpace, to the assets directory of the Android Hybrid Web Container template.
  3. Remove the ZIP file from the folder.
  4. Refresh the Eclipse workspace.
  5. Open the CustomizationHelper.java file, locate the ANDROID_CUSTOMIZATION_POINT_PREPACKAGED_APP customization point that accompanies the getPrepackageAppPath function, and change the contents of this function to return the name of the top-level directory you just added to the project.

    If the prepackaged Hybrid App manages the server connection by itself and wants to exit the Hybrid Web Container after exiting the prepackaged Hybrid App, change return value of the method exitHWCOnPrepackagedAppClose to true.

  6. To optionally enable the Hybrid Web Container to exit after closing the prepackaged Hybrid App, change the return value of the exitHWCOnPrepackagedAppClose method to true.
    The default return value of the method is false.