Java Reference
In-Depth Information
if (conn != null) {
try {
conn.close();
} catch (IOException ioe) {
System.out.println("Closing connection caught: ");
ioe.printStackTrace();
}
}
}
}
}
The basic structure is identical to the earlier SMS Sender class. However, the message
created here for sending is a MultipartMesssage . The subject of the message is set to “MMSMIDlet
Image”. For the one and only MessagePart , the MIME type is “image/png”, the content ID is
“id1”, and the content location is set to “location”. The actual content of the message part is the
image to be displayed on the destination device. The MessagePart is created, populated, and
then added to the message. The message is then sent using the MessageConnector in the sendMMS()
method, which is always called on a new thread.
Testing MMS Send and Receive
You can test out the MMSMIDlet using one of the following:
The WMA console utility of WTK 2.x
Two instances of the MMSMIDlet
Using the WMA Console
First, start the emulator running with an instance of the MMSMIDlet . From the KToolbar menu,
select File
Utilities. In the WMA box, click the Open Console button. This will start a console
with its own phone number (address). Click the Send MMS button; a dialog box will be shown
for entry of MMS header and message parts. Enter the information listed in Table 11-2 for
the header.
Table 11-2. Information for MMS Testing on WMA Console
Field
Value
Subject:
MMSMIDlet Image
Application-ID:
MMSMIDlet
To:
mms://+5550000:MMSMIDlet
This “to” address assumes that you are running the WTK in its default configuration. Click
the Parts tab, and add a part that includes the red.png image. Figure 11-5 shows the console
with the message part added.
 
Search WWH ::




Custom Search