Java ME MIDP Project Tasks: Quick Reference

This topic describes common tasks you can perform to create a Java ME MIDP application. For more detailed information, click the links in the right column.

To perform this task Follow these steps
Create a new project
  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Category, select Mobile. Under Projects, select the right template for your project. 
Import a project
  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Category, select Mobile. Under Projects, select the right template for your project. 
Set the main project
Create a MIDlet suite
  • See "Create New Project."
    When you create a Java ME MIDP project, the IDE creates all the necessary files for a MIDlet Suite.
Add an existing MIDlet
  1. Select a Project and choose File > "Active project name" Properties.
  2. Choose MIDlets from the left pane and click the Add button.
  3. Fill in the Add MIDlet dialog and click OK.
    The MIDlet is automatically added to the Application Descriptor (JAD) file.
Add a new MIDlet
  1. Select a Project and Choose File > New File (Ctrl-Shift-N).
  2. Select MIDP under Categories, then select MIDlet under File Types.
  3. Enter the appropriate information in the MIDlet wizard.
  4. Click Finish.
    The MIDlet is automatically added to the JAD file.
Change the active emulator platform
  1. Select a Project and choose File > "Active project name" Properties.
  2. Choose Platform from the right pane, then choose an installed emulator platform from the Emulator Platform dropdown menu.
Add an emulator platform
  1. Select a Project and choose File > "Active project name" Properties.
  2. Choose Platform from the right pane and click Manage Emulators.
  3. In the Java Platform Manager, Click Add Platform and follow the steps of the Add Platform wizard to add the emulator platform.
Edit the Application Descriptor (JAD) File
  1. Select a Project and choose File > "Active project name" Properties.
  2. Expand the Application Descriptor node and choose Attributes.
Add or remove files from the JAR file.
  1. Select a Project and choose File > "Active project name" Properties.
  2. Choose the Filtering node in the left pane and expand the folders in the right pane to reveal the contents of the JAR file.
  3. Put a check in the checkboxes of files you want to include in the JAR file, and uncheck the checkboxes of files you do not want to include.
Add API Permissions
  1. Select a Project and choose File > "Active project name" Properties.
  2. Expand the Application Descriptor node and choose the API Permissions node in the left pane.
  3. In the right pane, Click the Add button and use the dropdown menu in the Add API dialog to add API permissions.
Sign a MIDlet Suite
  1. Select a Project and choose File > "Active project name" Properties. Expand the Build node in the left pane and choose the Signing node.
  2. Check the Sign Distribution checkbox.
  3. Click the Open Security Manager button to add, import, or export a keystore.
Enable obfuscation
  1. Select a Project and choose File > "Active project name" Properties.
  2. Expand the Build node in the left pane and choose the Obfuscating node.
  3. In the left pane, use the Obfuscation Level control to set the obfuscation level .
    The Level Description pane describes each level of obfuscation.
Build a project with the active configuration
  • Choose Build > Build Main Project (F11) or right-click any project in the Projects window and choose Build Project.
Build all project configurations
  • Right-click on a project node and choose Build All Project Configurations.
Deploy all project configurations
  • Right-click on a project node and choose Deploy All Project Configurations.

Create and associate an ability with a configuration.

  1. Right-click on a project in the Files view and select Properties.
    This opens the Project Properties dialog.
  2. Select Abilities from the Category menu tree.
  3. If necessary, uncheck the Use Values From "DefaultConfiguration" checkbox.
  4. Click the Add Ability button.
  5. Enter a name for the new ability. Click OK.
    The new ability is listed in the Abilities window.Then click OK to close the Project Properties dialog.
Associate an ability with a configuration
  1. Right-click on a project in the Files view and select Properties.
    This opens the Project Properties dialog.
  2. Select Abilities from the Category menu tree.
    If necessary, uncheck the Use Values From "DefaultConfiguration" checkbox.
  3. Click the Add Ability button.
  4. Choose an ability from the Abilities dialog. Click OK.
Run a project
  • Choose Run > Run Main Project (F6) or right-click any project in the Projects window and choose Run Project.
Run a project with a different emulator platform or device emulator
  1. Right-click on a project and choose Quick Run With.
  2. Choose an installed emulator platform and device emulator from the dropdown menus.
    The project uses the current distribution JAR and does not rebuild the project before running.
Create a project configuration
  1. Select a Project and choose File > "Active project name" Properties.
  2. Choose Add Project Configuration from the Project Configuration drop-down menu.
  3. Enter a new configuration name.
  4. Uncheck the Use Values from "DefaultConfiguration" check box.
  5. Define other project configuration properties as desired.
Set the active configuration
  • Select a project and Choose File > Set Active Configuration. Or, you can choose the active configuration from the drop-down menu in the toolbar.
Customize a project configuration
  • Select a Project and choose File > "Active project name" Properties.
  • If necessary, uncheck the Use Values from "DefaultConfiguration" check box.
  • Customize the property sheets for the project.
  • Optionally, add preprocessor code blocks to further customize your application for multiple devices.
Debug a project
  • To debug the main project, choose Run  Debug Main Project (F5).
  • To debug any individual project, right-click the project and choose Debug Project.

Legal Notices