
|
December 2005 |
|
|
| |
|
In Sony Ericsson phones supporting Java Download MIDlet and source code sample>> The MMS message contains two parts: the MMS header and the message body. The body is a multipart message body; hence each message part is built of a header and a body (see diagram below). As the MMS is a multipart message, we can actually include several images or files in each MMS.
To create the message connection and header we can use the following code: This MMS is sent to a phone number and to an e-mail address. String address = "mms://+1555444333"; mulMsg.setAddress(address); The headers "X-Mms-Delivery-Time" and "X-Mms-Priority" can be set using the setHeader method. Other header fields are accessible indirectly using the MultipartMessage object. Here we add a text message to the MMS: String mimeType = "text/plain"; The MessagePart constructor will take all the header parameters and the message content as a byte array. Here we add a picture to the MMS: InputStream is = getClass().getResourceAsStream("image.jpg"); When the message is created and the message parts are added to the message we can send the MMS. msgConn.send(mulMsg); For more information download the JSR 205 (WMA 2.0) specification here>> | |
Copyright © 2001 - 2009 Sony Ericsson Mobile Communications AB. All Rights Reserved.