Generating Java Object API Code

Goal: Generate object API code for the SUP101 mobile application project.

  1. Right-click in the SUP101 the Mobile Application Diagram and select Generate Code.
  2. In the next page, select Continue without a configuration, and click Next.
    Note: This page of the code generation wizard is seen only if you are using the Advanced developer profile.
  3. Enter the information for these configuration options:
    Option Description
    Language Select Java.
    Platform Select Java ME for BlackBerry.
    Unwired Server Select My Unwired Server.
    Server domain The first domain in the list is chosen by default. Keep the default.
    Page size Leave blank. If you do not set the page size, the default page size is 4k at runtime.

    The page size should be larger than the sum of all the attributes' max-length and must be valid for the database.

    Note: The page size option is not enabled for message-based applications.
    Package Leave this blank.
    Destination Specify the Project path for the generated device client files: \SUP101\Generated Code.
    Replication-based Select to use replication-based synchronization for the application.
    Message-based This option is not supported for Java applications.
    Backward compatible Leave unchecked.
  4. Click Next.
  5. In Select Mobile Objects, select all the MBOs in the mobile application project or select MBOs under a specific domain, whose references, metadata, and dependencies (referenced MBOs) are included in the generated device code.
    Dependent MBOs are automatically added (or removed) from the Dependencies section depending on your selections.
    Note: Code generation fails if the server-side (run-time) enterprise information system (EIS) data sources referenced by the MBOs in the project are not running and available to connect to when you generate object API code.
  6. (Optional) Select Generate metadata classes to generate metadata for the attributes and operations of each generated client object.
  7. (Optional) Select Generate JavaDoc to generate API documentation from the source code.
  8. Click Finish.
  9. Click OK in the Success code generation dialog.
  10. An error icon appears next to the SUP101 mobile application project. This appears because the project is looking for a library that does not exist. To fix the error:
    1. Right-click the SUP101 mobile application project and select Properties.
    2. Select Java Build Path in the left pane, then click the Libraries tab.
    3. Select the sup.client.rim.afaria build path that shows the error icon, and click Remove.

      bb_buildpath_error
    4. Click OK.