Generating Java Object API Code

Generate object API code for the SUP101 mobile application project.

Prerequisites
You must be connected to both My Sample Database and My Unwired Server. 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.
Task
  1. In Unwired WorkSpace, open the SUP101 mobile application project.
    In WorkSpace Navigator, right-click the SUP101 folder and select Open in Diagram Editor.
    Note: If you do not see the SUP101 project in Workspace Navigator, you must first complete the Tutorial: Developing Mobile Business Objects, which is a prerequisite for this tutorial.
  2. If you are performing other tutorials, optionally add a new folder to the project in which to generate code for each device platform.
    For example, in WorkSpace Navigator, expand SUP101 and add a RIM folder under Generated Code.
  3. Right-click the SUP101 Mobile Application Diagram and select Generate Code.
  4. Click Next to continue without a configuration.
  5. Make sure the Customer MBO is selected, then click Next.
  6. Specify the following configuration options:
    Option Description
    Language Select Java.
    Platform Select Java ME for BlackBerry.
    Unwired Server Select My Unwired Server.
    Server domain Select default.
    Page size Select 1024.
    Package Optionally enter a unique name for the Java package.
    Destination /SUP101/Generated Code, or another folder that you created for this device platform in Step 3.
    Generate JavaDoc Unselect for this tutorial.
  7. Click Finish.
    You can ignore the error icons that appear in WorkSpace Navigator under Generated Code/src/SUP101, and the error, net cannot be resolved, in the Problems view.

    The error occurs because the package java file called by SUP101DB.jar is not yet in the project build path. The errors will be resolved later, when you build the application in the BlackBerry Java Plug-in for Eclipse.

  8. Click OK in the Success dialog.