Including a Prepackaged Hybrid App in the Windows Mobile Hybrid Web Container

Run a prepackaged 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. Include the generated Hybrid App files in a Visual Studio project:
    1. Copy the generated Hybrid App files to your Visual Studio project.
    2. Open the HybridWebContainer.csproj, which is in the WM_HWC<version>.zip file.
    3. In Visual Studio Solution Explorer, select Show All Files.
    4. Right-click the Hybrid App folder and select Include in Project.
    5. Set the Copy to Output Directory property to Copy if newer for all the files under this folder.
      Note: You can select all the files using the SHIFT CTRL keys, and then set the property for all the selected files.
  3. In the CustomCode folder, create a Partial class for CustomizationHelper.cs.
  4. In the Partial class of the CustomizationHelper.cs file, create a method to override the property PrepackageAppPath to return the full installation path of the Hybrid App on the device.
    public override string PrepackageAppPath
          {
             get
             {
               return @"\Program Files\sybase\hwc\iMOWebProto";
             }
          } 
  5. Rebuild the project.
  6. Include the prepackaged Hybrid App in a CAB file:
    Most Windows Mobile applications are deployed as CAB files. You can find information about creating CAB files at http://msdn.microsoft.com/en-us/library/aa448616.aspx and information about the .inf file at http://msdn.microsoft.com/en-us/library/aa448654.aspx.
    1. Open the onebridge_ppc.inf file, which is located in the Tools folder of the Hybrid Web Container template project.
    2. Add the prepackaged Hybrid App folders in the [SourceDisksNames.ARM] section:
      [SourceDisksNames.ARM]
      1=,"PPC",,unsigned
      3=,"zh-CN",,"unsigned\zh_CN"
      4=,"zh-HK",,"unsigned\zh_HK"
      5=,"de",,"unsigned\de"
      6=,"fr",,"unsigned\fr"
      7=,"fr-CA",,"unsigned\fr_CA"
      8=,"ja",,"unsigned\ja"
      9=,"es",,"unsigned\es"
      10=,"prepackage",,"unsigned\prepackage"
      11=,"prepackage.css",,"unsigned\prepackage\html\css"
      12=,"prepackage.default",,"unsigned\prepackage\html\default"
      13=,"prepackage.en",,"unsigned\prepackage\html\en"
      14=,"prepackage.en_US",,"unsigned\prepackage\html\en_US"
      15=,"prepackage.icon",,"unsigned\prepackage\html\icon"
      16=,"prepackage.images",,"unsigned\prepackage\html\images"
      17=,"prepackage.js",,"unsigned\prepackage\html\js"
      18=,"prepackage.html",,"unsigned\prepackage\html"
    3. List all the required files in the [SourceDisksFiles.ARM] section:
      [SourceDisksFiles.ARM]
      CMessagingClient.2.2.0.dll=1
      OBSetup.dll=1
      HWCA.exe=1
      HWCEngine.lnk=1
      Plugins.xml=1
      ; other files
      hybridapplib.dll=1
      SQLite.Interop.DLL=1
      System.Data.SQLite.dll=1
      version.txt=1
      config.properties=1
      WorkflowClient.xml=10
      index.xml=10
      manifest.xml=10
      "Stylesheet.css"=11
      "hybridapp.html"=12
      "hybridapp.html"=13
      "hybridapp.html"=14
      "API.js"=17
      "Callbacks.js"=17
    4. Define the installation target in the [DestinationDirs] section:
      [DestinationDirs]
      Files.ARM = 0,%InstallDir%
      Shortcuts.All = 0,%CE4%
      System.ARM = 0,%CE2%
      zh-CN = 0,%InstallDir%\zh-CN
      zh-HK = 0,%InstallDir%\zh-HK
      de = 0,%InstallDir%\de
      fr = 0,%InstallDir%\fr
      fr-CA = 0,%InstallDir%\fr-CA
      ja = 0,%InstallDir%\ja
      es = 0,%InstallDir%\es
      prepackage.css = 0,"%InstallDir%\prepackage\html\css"
      prepackage.default = 0,"%InstallDir%\prepackage\html\default"
      prepackage.en = 0,"%InstallDir%\prepackage\html\en"
      prepackage.en_US = 0,"%InstallDir%\prepackage\html\en_US"
      prepackage.icon = 0,"%InstallDir%\prepackage\html\icon"
      prepackage.images = 0,"%InstallDir%\prepackage\html\images"
      prepackage.js = 0,"%InstallDir%\prepackage\html\js"
      prepackage.html = 0,"%InstallDir%\prepackage"
      prepackage = 0,"%InstallDir%\prepackage"
    5. Describe each file mapping in the File List section:
      [prepackage.css]
      Stylesheet.css,,0
      
      [prepackage.default]
      hybridapp.html,,0
      
      [prepackage.en]
      "hybridapp.html"
      
      [prepackage.en_US]
      "hybridapp.html"
      
      [prepackage.icon]
      
      [prepackage.images]
      
      [prepackage.js]
      "API.js"
      "Callbacks.js"
      "Camera.js"
      "Certificate.js"
      "Custom.js"
      "datajs-1.0.2.js"
      "ExternalResource.js"
      "json2.js"
      "MAKit.js"
      "Resources.js"
      "SUP0.js"
      "SUPStorage.js"
      "Timezone.js"
      "Utils.js"
      "HybridApp.js"
      "WorkflowMessage.js"
      
      [prepackage]
      "index.xml"
      "manifest.xml"
      "WorkflowClient.xml"
      
      [prepackage.html]
      hybridapp.html
      
      [System.ARM]
      manifest.xml,,0
    6. Include all the file lists in section [DefaultInstall.ARM]:
      [DefaultInstall.ARM]
      CopyFiles=Files.ARM,System.ARM,de,fr,fr-CA,es,zh-CN,zh-HK,ja,prepackage,
      prepackage.css,prepackage.default,prepackage.en,prepackage.en_US,
      prepackage.icon,prepackage.images,prepackage.js,prepackage.html
    7. Run: buildcab.pl <Path to project output>.
  7. Deploy and run the customized Hybrid Web Container on the device or emulator.
    1. Compile the Hybrid Web Container.
    2. Deploy the Hybrid Web Container to the device or emulator.
    3. Run and test the prepackaged Hybrid App.