Generating Code for a Device Application

Generate device application code containing mobile business object references that allows you to use APIs to develop device applications for various mobile devices.

Prerequisites 

Before generating device client code, develop the MBOs that are to be referenced in the device applications you are developing.

  1. Launch the Code Generation wizard.
    From Action
    The Mobile Application Diagram Right-click within the Mobile Application Diagram and select Generate Code.
    WorkSpace Navigator Right-click the Mobile Application project folder that contains the mobile objects for which you are generating device code and select Generate Code.
  2. Follow the wizard instructions and click Finish to generate the device client code.
    Table 1. Device client code generation wizard instructions
    Screen Description
    Select code generation configuration Select either an existing configuration that contains code generation settings, or generate device client code without using a configuration:
    • Continue without a configuration – select this option to generate device code without using a configuration.
    • Select an existing configuration – select this option to either select an existing configuration from which you generate device client code, or create a new configuration. Selecting this option enables:
      • Select code generation configuration – lists any existing configurations, from which you can select and use for this session. You can also delete any and all existing saved configurations.
      • Create new configuration – enter the Name of the new configuration and click Create to save the configuration for future sessions.

        Select an existing configuration as a starting point for this session and click Clone to modify the configuration.

    Select Mobile Business Objects Select the MBOs (or entire projects) 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. Optionally Generate metadata classes for all selected MBOs.
    Configure Options Configure various options associated with the generated device code, including:
    • Language – the language and language version used for developing the client applications, Java (include a JDK version), or C# (include a .Net version).
    • Platform – select the platform ( target device) from the drop-down list for which the device client code is intended. The platform is dependent on the language selected.
      Note: For File MBO's, if Java is the selected language, code generation is only supported for the RIM (BlackBerry) platform.
    • Unwired Server – you can specify a default Unwired Server connection profile to which the generated code connects to at runtime.
    • Encoding – select an option from the drop-down list.
    • Package/Namespace – enter either a package name (for Java) or a namespace (for C#).
    • Destination – specify the destination of the generated device client files. Enter (or Browse) to either a Project path (Mobile Application project) location or OS path (file system) location. You can clean up the destination before generating the device client files by selecting Clean up destination before code generation.
      Note: If you select Java as the language, enter a project path, specify a mobile application project folder, and select Generated Code as the destination, JAR files are automatically added to the destination for the particular platform that support compiling of the generated client code.
    • Select Add to option list... to create a profile that stores your options. You can create and modify option lists with different criteria (platform, language, path, and so on) allowing you to generate the same device client code and delivering it in multiple ways.

      Expand Custom Options to manage custom options (create, delete, and add to the option list).

    • Option list – lists the options you have created.


Created September 17, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com