Multi-Configurations

Multi-configurations concept are introduced mainly for resolve device fragmentation issue. A configuration contains a device and a set of preprocess symbols. The symbols will be used by preprocessor. We use these information to build the Midlet project for one device. While a Midlet project can have many configurations, we can build for many device according configurations.

- Configurations Management

- Add Configuration
- Edit Configuration
- Remove Configuration
- Switch Active Configuration
- Save Configurations

- Packaging for multi configurations

## Configurations Management

You can manage project configurations in three places: project create wizard, project properties dialog and Application Descriptor Editor:

From now on we will call the user interface in the red box as Configurations Management UI.

#### Add Configuration

You can add a configuration to a Midlet project.
Click "Add..." button on Configurations Management UI, you will see Add Configuration Dialog:

First,you should select a device. Then the configuration name and symbols will generate automatically. You can also edit configuration name and add/remove/edit symbols.
You can also choose one or more workspace scope symbol definition sets if you have defined some. See Defining Symbols for details.

#### Edit Configuration

Select a configuration on Configurations Management UI, and click "Edit..." button, then you will see a dialog allow you to edit existing configuration. The Edit Configuration Dialog is much same as Add Configuration Dialog.

#### Remove Configuration

Select one or more configurations on Configurations Management UI, and click "Remove" button, selected configurations will be deleted.
If you click "Cancel" in project properties or close Application Descriptor Editor without saving, the remove configuration operation will not take effect.
If you try to delete all of the configurations, you will receive a error message box tell you that a project must have at least one configuration.

#### Switch Active Configuration

A Midlet project can have only one active configuration. MTJ will use the device contained by the active configuration as its current device.
To switch active configuration, set the check box checked of a configuration on the Configurations Management UI, and click "OK" on project properties dialog, or perform save in Application Descriptor Editor.

#### Save Configurations

There two way to save modifications you made against configurations.
1. In "Java ME" project properties page, click "OK" or "Apply" button.
2. In Application Descriptor Editor, click "Save" button on tool bar or press "Ctrl+s" on keyboard.
If 1. you made any change(except switch active configurations) against configurations then do save, and 2. you have already export Antenna build files, MTJ will ask you if you want reexport Antenna build files again. As shown in the following snapshot.

## Packaging for multi configurations

Your project could have many configurations, so you can build for multi-target.
You can use MTJ packaging functionality to package for multi configurations at one click.
You can also use MTJ exported Antenna build scripts to pakcaging for multi configurations.
For more information about packaging, please refer Packaging and Antenna Support