Create a new MIDlet
You will now create a new MIDlet (which will become your To do list). In the IDE, you see on the left the Project Tree, which has three sections. The first is called "Project Groups", and contains a list of group names. Each of these items represents a group of files which will appear in the box on the right when selected. For example, if you chose 'Java Source Files', all of the Java source files would appear in the box on the right.
- Choose the first item in Project Groups, labeled 'Composer Files'.
- To see what our tutorial will look like when finished, double click on Finished.Midlet. (You can also choose 'Open' from Finished.Midlet's pop-up menu or select Finished.Midlet with the mouse and choose 'Open' from the Edit menu.)
Three new windows appear. One of these will be titled MID Emulator. It will have a picture of a Palm OS Platform device. It is running a program which has two screens. The first screen is titled "Things to Do", and has an exit and an add button. Pressing the add button will display the second screen of the program, titled "Add an item". To do items may be entered on this screen. If the emulator is showing a keypad you may enter text on the keypad in the emulator. You will probably prefer to enter text by using your computer's keyboard. Please enter some text. After you type in the text, pressing the Ok button will add the item to the "Things to Do" screen and switch back to that first screen.
You may switch emulators at any time during the design process by selecting Menu in the upper left corner of the emulator. This brings up the Emulator menu. Select Configure Emulator..., which opens the MID Configuration window. This window lets you change the behavior of the Emulator. On the left-hand side of the window is a tree of different devices. Expand the "PalmOne" heading and select "Tungsten_C", and press Ok. The Emulator now looks like a Tungsten C device.- When you are finished, choose Exit from the File menu of the first window, titled 'MIDlet Composer'. Press none when asked if you would like to save any changes.
Now you will create your own version of the To Do List.
- In the IDE, choose MIDlet from the Create menu. This creates a new MIDlet in the current project. (You can also press the 'Create a MIDlet' button on the button bar. It is the fourth button with the cell phone on it.)
A new Icon appears in the 'Composer Files' group with a name similar to Untitled0.Midlet.- Click this new icon once to select it. (It will become highlighted.)
- From the Edit menu, choose Rename selection. A text field will appear to the right of the icon. Replace the old name with a more descriptive title, 'to do'. Click the mouse anywhere else in the right hand window to accept the change. If you don't specify the '.Midlet' extension, Simplicity will add it for you. Simplicity will also modify the spacing and capitalization to conform to Java naming conventions.
- Double click the new 'ToDo.Midlet' icon to open the MIDlet Composer.
You have now created a new MIDlet, and have loaded it into the MIDlet Composer. You should see three new Windows on the screen. They are the Composer window, the Mobile Devices Palette, and a window titled MID Emulator. It will have a picture of a Palm OS Platform device, with the words "Simplicity for Mobile Devices' MID Emulator Copyright 2001-2004, Data Representations, Inc." displayed in it. This is the Emulator where your MIDlet will be displayed as you create it.
The composer window is the place where you will set up all of the parts of your MIDlet. It is also where you will be able to supply all the code that your MIDlet will need.
On the left side of the composer window is the Parts tree. This is a tree listing of all of the MIDlets currently open as well as their contents. This area will be where you will drag new parts of your MIDlets, and where you can rearrange the order of the parts of your MIDlet. It also provides a quick way to switch from one part to another in your MIDlet. The different nodes on the tree may be expanded or collapsed to show the parts of the MIDlet which you are currently working on.
On the right side of the composer window is the title, contextual help, and Property sheet for the selected part. The Property sheet will be used to change the initial settings of the parts in your MIDlet.
The third window, the Mobile Devices Palette, contains icons of the parts which you will be adding to your MIDlet.
| Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |