Building the Android Hybrid Web Container Using the Provided Source Code

The Hybrid Web Container in this procedure is a sample container provided with the Sybase Unwired Platform Mobile SDK installation.

Prerequisites
Task

This example uses Eclipse as the development environment, but you can use any development environment.

  1. Open Eclipse and select File > Import.
  2. Expand the General folder, choose Existing Projects into Workspace, and click Next.
  3. Choose Select archive file, browse to <UnwiredPlatform_InstallDir>\UnwiredPlatform\MobileSDK<version>\HybridWeb\Android, and select template.zip.
  4. Click Finish.
    A Hybrid Web Container project folder is added to Workspace Navigator. You may receive an error indicating that the source folder gen is missing. If so, add an empty folder named gen to the src folder in the project.
  5. Open the local.properties file in the main directory of the project. This file contains a non-commented line, sdk.dir = <filepath>. Verify the <filepath> matches the filepath to your installation of the Android SDK.
  6. If you receive an Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties error, follow the instructions and then clean the project.
  7. If you receive errors of the type … must override a superclass method, make sure the Java compiler has its compliance set to 1.6.
    1. Right-click the HybridWebContainer project and select Properties.
    2. Go to the Java Compiler section and set the Compiler compliance level to 1.6.
    3. Rebuild the project.
Related tasks
Testing Android Hybrid Web Containers
Related reference
Android Hybrid Web Container Customization