Importing Java ME Projects

See Also

There are four project templates you can use to import a Java ME MIDP project:

To import a Sun Java Wireless Toolkit project:

  1. Choose File > New Project.
  2. Under Categories, select Java ME. Under Projects, select Import Wireless Toolkit Project and click Next.
  3. In the Specify WTK Toolkit project page, browse to select the project you want to import. Click Next.
  4. In the Project Name and Location page, choose a home and a location for the new project. If you want the project to be your main project, leave the Set as Main Project check box checked. Click Next.
  5. Use the Platform Selection page to set the emulator platform that the IDE will use to compile and run the project. Click Finish.
  6. To test the Project, right-click the project node in the projects tab, and choose Run Project.

To import a Java ME project from existing MIDP sources:

  1. Choose File > New Project.
  2. Under Categories, select Java ME. Under Projects, select Mobile Project with Existing MIDP Sources and click Next.
  3. Use the Specify Sources page to locate the source directory for the source code and .jad file you want to import. Click Next.
  4. Use the Project Name and Location page to define a new name and location for your NetBeans project. Click Next.
  5. Use the Platform Selection page to select the platform emulator that will be used to emulate device performance when the project is executed. Click Finish.

To Import an Antenna Project:

The NetBeans Java ME preprocessor is almost fully compatible with the Antenna preprocessor, so you can import Antenna projects and preserve the preprocessing code from the original project.

To import an Antenna project, follow these steps.

  1. Create a new project
    1. Choose File > New Project (Ctrl-Shift-N).
    2. Under Categories, select Java ME. Under Projects, select Mobile Project with Existing MIDP Sources and click Next.
    3. Use the Specify MIDP Sources page to locate the source directory for the source code and (optionally) the .jad file you want to import.
    4. Click Next. Use the Project Name and Location page to define a new name and location for your NetBeans project. Click Finish.
  2. Create project configurations for each of the symbols (mobile devices) listed in your original project. For example, for the following line of code in the build.xml file:
    <wtkpreprocess srcdir="src" destdir="src_colorphone" symbols="colorphone,JSR185,JSR172," verbose="true"/>
    you would create a configuration for the symbol (mobile device) "colorphone."
    1. In the Projects view, right click on the project node and choose Properties from the pop-up menu.
    2. Click the Manage Configurations button.
      This opens the the Project Configuration Manager.
    3. Click the Add button.
      This opens the Add Project Configuration dialog.
    4. Add the name of a symbol (mobile device) listed in the build.xml file, in this case "colorphone". Be sure to match the symbol names precisely. Click OK to create the configuration.
    5. Repeat as necessary.
  3. Add abilities to each configuration.
    1. In the Properties window, under Categories, click the Abilities node.
    2. Uncheck the Use Values from "DefaultConfiguration" check box.
    3. Click the Add button and add abilities for each configuration so that they correspond to the non-device symbols listed in your build.xml file.
      For example, if you are in the colorphone configuration and the build.xml file has the code
      <wtkpreprocess srcdir="src" destdir="src_colorphone" symbols="colorphone,JSR185,JSR172," verbose="true"/>
      you would add abilities for JSR185 and JSR172.
    4. Delete excess abilities that have nothing to do with the antenna sources just imported.

You can now build and run your applications in the IDE.

To import a project created in Mobility Pack for CDC 5.5:

To import a project created with the Sun Java Toolkit for CDC:

  1. Choose File > New Project.
  2. Under Categories, select Java ME. Under Projects, select Import CDC Toolkit Project and click Next.
  3. In the Specify CDC Toolkit project page, browse to select the project you want to import. Click Next.
  4. In the Project Name and Location page, choose a home and a location for the new project. If you want the project to be your main project, leave the Set as Main Project check box checked. Click Next.
  5. Use the Platform Selection page to set the emulator platform that the IDE will use to compile and run the project. Click Finish.
  6. To test the Project, right-click the project node in the projects tab, and choose Run Project.
See Also
Working with Projects
Java ME MIDP Project and File Templates
About Project Configurations
About Preprocessing

Legal Notices