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 |
- Choose File > New Project (Ctrl-Shift-N).
- Under Categories, select Java ME. Under Projects, select MIDP Application.
- Name your Project and choose its Location.
- Select the appropriate emulator platform and device information for your project.
- Select a project configuration that suits the needs of your project.
|
Import a project |
- Choose File > New Project (Ctrl-Shift-N).
- 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 |
- Right-click on a project and choose Properties.
- Select Application Descriptor from the Categories window and select
the MIDlet tab in the right pane.
- Click the Add button.
- Fill in the Add MIDlet dialog and click OK.
The MIDlet is automatically added to the Application Descriptor (JAD)
file.
|
Add a new MIDlet |
- Select a Project and Choose File > New File (Ctrl+N).
- Select MIDP under Categories, then select the
desired file template under File Types.
- Enter the appropriate information in the MIDlet wizard.
- Click Finish.
The MIDlet is automatically added to the JAD file.
|
Change the active emulator platform |
- Right-click on a project and choose Properties.
- Choose Platform from the right pane, then choose an installed emulator
platform from the Emulator Platform drop-down menu.
|
Add an emulator platform |
- Right-click on a project and choose Properties.
- Choose Platform from the left pane and click Manage Emulators.
- 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 |
- Right-click on a project and choose Properties.
- Select the Application Descriptor category.
- 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. |
- Right-click on a project and choose Properties.
- 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.
- 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 |
- Right-click on a project and choose Properties. Expand the Build node
in the left pane and choose the Signing
node.
- Check the Sign Distribution check box.
- Click the Open Keystores Manager button to add, import, or export
a keystore.
|
Enable obfuscation |
- Right-click on a project and choose Properties.
- Expand the Build node in the left pane and choose the Obfuscating
node.
- 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 |
- Right-click on a project node and choose Batch Build.
- In the Build Selected Project Configurations dialog, check the box
of each configuration you want to build.
- 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. |
- Right-click on a project in the Files view and select Properties.
This opens the Project Properties dialog.
- Select Abilities
from the Category menu tree.
- If necessary, uncheck the "Use Values From DefaultConfiguration"
check box.
- Click the Add Ability button.
- Enter a name for the new ability and, optionally, a value. Click OK.
The new ability is listed in the Abilities window.
- Click OK to close the Project Properties dialog.
|
Associate an ability with a configuration |
- Right-click on a project in the Files view and select Properties.
This opens the Project Properties dialog.
- Select Abilities
from the Category menu tree.
If necessary, uncheck the Use Values From "DefaultConfiguration"
checkbox.
- Click the Add Ability button.
- 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 |
- Select a Project and choose File > "Active project name"
Properties.
- Choose Add Project Configuration from the Project Configuration drop-down menu.
- Enter a new configuration name.
- Uncheck the Use Values from "DefaultConfiguration" check
box.
- 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.
|