Java Reference
In-Depth Information
Setting Your Dating Preferences
Next, you need to set five MIDlet properties using KToolbar: click the Settings button, click the
User Defined tab, and add the MIDlet properties in Table 12-3.
Table 12-3. MIDlet Properties for BTMIDlet Project
Key
Value
BTMIDlet-mycontact
tallguy@yahoo.com
BTMIDlet-myheight
tall
BTMIDlet-mypref
male
BTMIDlet-seekheight
short
BTMIDlet-seekpref
female
To keep things simple, this example assumes you're a tall male, looking for a short female.
To test this MIDlet, you will need to start two instances of the emulator. The second
instance must emulate the subject of your dating interest. To make this happen, create a new
project called BT2, with the MIDlet name BTMIDlet . Copy the two source files into the src directory
of the new BT2 project. Build the project. Next, enter the MIDlet properties in Table 12-4 for
this project.
Table 12-4. MIDlet Properties for BT2 Project
Key
Value
BTMIDlet-mycontact
shortgal@yahoo.com
BTMIDlet-myheight
short
BTMIDlet-mypref
female
BTMIDlet-seekheight
tall
BTMIDlet-seekpref
male
Finally, run an instance of BT2. Without starting another KToolbar, open the BTMIDlet
project, and run an instance of BTMIDlet . Now, launch both MIDlets. On initial startup, the
security manager will ask for your permission to use Bluetooth. You need to approve it. Shortly
after starting, you will see that the owners of the two devices have found each other, as shown
in Figure 12-4.
Search WWH ::




Custom Search