Including a Prepackaged Hybrid App in the BlackBerry Hybrid Web Container
Run a prepackaged so that the Hybrid Web Container functions as a
single-purpose application rather than a general purpose one.
Prerequisites
Install the BlackBerry Java Plug-in for Eclipse.
Task
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.
In Eclipse, import the BlackBerry Hybrid Web Container template as a legacy BlackBerry
project:
Select File > Import.
Expand the BlackBerry folder.
Select Import Legacy BlackBerry Projects.
Click Next.
Specify the JRE and, in the BlackBerry Workspace field, browse to the
HWCtemplate.jdw file and select the project to
import.
Select Copy BlackBerry projects into workspace to create a copy of
the imported project in the Eclipse workspace.
Click Finish.
Copy the generated Hybrid App folder under the package tool
workspace to the res directory of the imported Eclipse
BlackBerry Hybrid Web Container project.
Remove the ZIP file from the folder, and refresh the Eclipse workspace.
Open the the CustomizationHelper.java file for editing.
Find the BLACKBERRY_CUSTOMIZATION_POINT_PREPACKAGE_APP that
accompanies the getPrepackagedAppPath function, and change the
contents of the 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.