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 Categories, select Java ME. Under Projects, select MIDP Application.
  3. Name your Project and choose its Location.
  4. Select the appropriate emulator platform and device information for your project.
  5. Select a project configuration that suits the needs of your project.
Import a project
  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Category, select Java ME. Under Projects, select the right template for your project. 
Set the main project
Create a MIDlet suite
Add an existing MIDlet
  1. Right-click on a project and choose Properties.
  2. Select Application Descriptor from the Categories window and select the MIDlet tab in the right pane.
  3. Click the Add button.
  4. 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+N).
  2. Select MIDP under Categories, then select the desired file template 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. Right-click on a project and choose Properties.
  2. Choose Platform from the right pane, then choose an installed emulator platform from the Emulator Platform drop-down menu.
Add an emulator platform
  1. Right-click on a project and choose Properties.
  2. Choose Platform from the left 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.
  • Alternately, you can open the Java Platform Manager by choosing Tools > Java Platforms.
Automatically increment the application version with each build
  • Right-click on a project and choose Properties.
  • Choose General from the left pane.
  • Edit the Application Version Counter field displays the next version number to be used. The default advance is 0.0.1.
    To advance the number beyond this, use the drop-down menu to select a new digit, or enter the value into the field. For example, changing the value to 3 results in a build number of 0.0.3. changing the value to 100 results in the version number 0.1.0.

 

Edit the Application Descriptor (JAD) File
  1. Right-click on a project and choose Properties.
  2. Select the Application Descriptor category.
  3. Select the appropriate tab to change the Attributes, MIDlet, API permissions, or Push Registry property settings.
    Changes to these properties are automatically reflected in the JAD file.
Add or remove files from the JAR file.
  1. Right-click on a project and choose Properties.
  2. Choose the Sources 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
Sign a MIDlet Suite
  1. Right-click on a project and choose Properties. Expand the Build node in the left pane and choose the Signing node.
  2. Check the Sign Distribution check box.
  3. Click the Open Keystores Manager button to add, import, or export a keystore.
Enable obfuscation
  1. Right-click on a project and choose Properties.
  2. Expand the Build node in the left pane and choose the Obfuscating node.
  3. 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 (or selected) project configurations
  1. Right-click on a project node and choose Batch Build.
  2. In the Build Selected Project Configurations dialog, check the box of each configuration you want to build.
  3. Click OK.
    The IDE creates a separate JAR file for each configuration.
Deploy all project configurations
  • Right-click on a project node and choose Batch Deploy.
  • In the Deploy Selected Project Configurations dialog, check the box of each configuration you want to deploy.
  • Click OK.
    The IDE deploys a separate JAR file for each configuration according to the Deploy property settings for that configuration.

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" check box.
  4. Click the Add Ability button.
  5. Enter a name for the new ability and, optionally, a value. Click OK.
    The new ability is listed in the Abilities window.
  6. 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.
Create or add 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
  • Choose the active configuration from the drop-down menu in the toolbar.
Customize a project configuration
  • Select a Project and choose File > "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 Debug > Debug Main Project (Ctrl+F5).
  • To debug any individual project, right-click the project and choose Debug.
Deploy a project to a mobile device
  • To deploy a project, choose File > "project name" Properties.
  • In the Project Properties dialog, select the Deploying node from the Category tree.
  • Choose the phone you are deploying to from the Select Deployment Method dropdown menu.
  • Click Manage Deployment, then Add Instance to create a custom instance for deployment, or use the current setting as the default instance.
  • Right-click on the project and choose Deploy Project.

Legal Notices