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 Category, select Mobile. Under Projects, select the right template
for your project.
|
Import a project |
- Choose File > New Project (Ctrl-Shift-N).
- 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 |
- Select a Project and choose File > "Active project name"
Properties.
- Choose MIDlets from the
left pane and 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-Shift-N).
- Select MIDP under Categories, then select MIDlet
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 |
- Select a Project and choose File > "Active project name"
Properties.
- Choose Platform from the right pane, then choose an installed emulator
platform from the Emulator Platform dropdown menu.
|
Add an emulator platform |
- Select a Project and choose File > "Active project name"
Properties.
- Choose Platform from the right 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.
|
Edit the Application Descriptor (JAD) File |
- Select a Project and choose File > "Active project name"
Properties.
- Expand the Application Descriptor node and choose Attributes.
|
Add or remove files from the JAR file. |
- Select a Project and choose File > "Active project name"
Properties.
- Choose the 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 |
- Select a Project and choose File > "Active project name"
Properties.
- Expand the Application Descriptor node and choose the API
Permissions node in the left pane.
- 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 |
- Select a Project and choose File > "Active project name"
Properties. Expand the Build node in the left pane and choose the Signing
node.
- Check the Sign Distribution checkbox.
- Click the Open Security Manager button to add, import, or export a
keystore.
|
Enable obfuscation |
- Select a Project and choose File > "Active project name"
Properties.
- Expand the Build node in the left pane and choose the Obfuscating
node.
- 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. |
- 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.
- 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 |
- 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.
|
Run a project with a different emulator platform or device emulator |
- Right-click on a project and choose Quick Run With.
- 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 |
- 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 |
- 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.
|