public class SMILMessage extends MMSMessage implements java.io.Serializable
MMSMessage
extended by a SMIL document to
organise the presentation.MMSMessagePart
on the terminal screen
and other devices such as a speaker. With SMILMessage, she sender of the MMS has the
possibility to organise the multimedia content to a meaningful order and to instruct how the
MMSMessagePart
are rendered at the receiving terminal.
The MMSMessagePart
of the SMILMessage
must be referenced by the SMIL document, otherwise they might be ignored at the
target terminal.
Since the smil-document refers to the messageParts, the MMS is called SMILMessage.
Example:
Assuming in your "/tmp" directory you've got a smil document called "smil.xml" which
looks like this:
<smil> <head> <layout><root-layout width="160" height="140"/></layout> </head> <body> <par dur="5s"> <text src="blabla.txt"/> </par> <par dur="5s"> <img src="picture.jpg"/> </par> </body> </smil>
You may now instantiate the MMSMessage related with this document:
// jSMS will load the refered "blabla.txt" and "picture.jpg" files which must
// also be located in the same directory
MMSMessage msg = new SMILMessage(new File("/tmp/smil.xml").toURL());
// add destination (must be set do send a MMSMessage)
msg.addTO(new MMSAddress(MMSAddress.ADDRESS_TYPE_MSISDN, "0785555555"));
// ready to send the MMSMessage using the MMSService
.
mmsService.send(msg);
CLASS_ADVERTISEMENT, CLASS_AUTO, CLASS_INFORMATIONAL, CLASS_PERSONAL, CONTENT_TYPE_MIXED, CONTENT_TYPE_RELATED, PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, VERSION_1_0, VERSION_1_1, VERSION_1_2, VERSION_1_3
Constructor and Description |
---|
SMILMessage(SmilDocument doc)
Creates a SMILMessage out of a
SmilDocument . |
SMILMessage(java.lang.String smil)
Construct a SMIL message.
|
SMILMessage(java.net.URL path)
Loads a SMIL document form the given URL.
|
Modifier and Type | Method and Description |
---|---|
void |
export(java.lang.String directory)
Writes the content of the SMILMessage to the given directory.
|
java.lang.String |
getContentType()
Returns the MessageContentType of the Message (also known as PDU type ).
|
java.lang.String |
getSmilAsString()
Get the SMIL document in a StringRepresentation.
|
java.lang.String |
toString() |
addBCC, addCC, addMessagePart, addTO, containsHeader, getAdaptationAllowed, getApplicationId, getAuxApplicationInfo, getBCC, getCC, getContentClass, getDeliveryDate, getDeliveryReport, getDRMContent, getExpiryDate, getFrom, getHeader, getHeaderNames, getMessageClass, getMessageId, getMessageParts, getPriority, getProperty, getReadReport, getReplyApplicationId, getReplyCharging, getReplyChargingDeadLine, getReplyChargingId, getReplyChargingSize, getSubject, getSubmissionDate, getTO, getTransactionId, getVersion, isSenderVisible, parseMMSEncoding, parseMMSEncoding, removeBCC, removeCC, removeTO, setAdaptationAllowed, setApplicationId, setAuxApplicationInfo, setContentClass, setContentType, setDeliveryDate, setDeliveryReport, setDRMContent, setExpiryDate, setFrom, setHeader, setMessageClass, setMessageId, setPriority, setProperty, setReadReport, setReplyApplicationId, setReplyCharging, setReplyChargingDeadLine, setReplyChargingId, setReplyChargingSize, setSenderVisibility, setSubject, setSubmissionDate, setTransactionId, setVersion
public SMILMessage(SmilDocument doc)
SmilDocument
.
The multimedia objects which are referenced by the SMIL-document are stored internally as
MMSMessagePart
.public SMILMessage(java.net.URL path) throws java.io.IOException
The multimedia objects which are referenced by the SMIL-document are loaded and stored internally as
MMSMessagePart
.
Note: only relative referenced media parts are supported!
path
- location of smil documentjava.io.IOException
- if jSMS fails to load smil documment or refered partsjava.lang.IllegalArgumentException
- if given path is not validpublic SMILMessage(java.lang.String smil)
addElement
method
for each multimedia element.smil
- a String holding the SMIL (XML) document.public void export(java.lang.String directory) throws java.io.IOException
export
in class MMSMessage
directory
- the directory where the message-parts are stored. If
this directory does not exist, it will be created.java.io.IOException
- if an I/O error occurs.public java.lang.String getSmilAsString()
public java.lang.String getContentType()
getContentType
in class MMSMessage
public java.lang.String toString()
toString
in class MMSMessage
object XP, Inc. © 2000-2013. All rights reserved object XP