📄 package-summary.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Tue Apr 23 16:45:51 EEST 2002 -->
<TITLE>
com.nokia.mid.messaging(Nokia SMS API)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="com.nokia.mid.messaging(Nokia SMS API)";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a href=http://forum.nokia.com/java target=_top><img src=../../../../doc-files/forum_logo.gif border=0></a></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV PACKAGE
NEXT PACKAGE</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<H2>
Package com.nokia.mid.messaging
</H2>
Sending and receiving messages
As usual with the Generic Connection Framework, the message sending and receiving functionality is implemented by a Connection interface, in this case MessageConnection.
<P>
<B>See:</B>
<BR>
<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="BinaryMessage.html"><I>BinaryMessage</I></A></B></TD>
<TD>An interface representing a binary message Object instances implementing this interface are just containers for the data that is passed in. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="Message.html"><I>Message</I></A></B></TD>
<TD>Base interface representing a message This interface contains the functionality common to all messages. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageConnection.html"><I>MessageConnection</I></A></B></TD>
<TD>The MessageConnection interface defines the basic functionality for sending and receiving message. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageListener.html"><I>MessageListener</I></A></B></TD>
<TD>The MessageListener interface is an interface that can be implemented by a class of the application to get notified of incoming messages. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="TextMessage.html"><I>TextMessage</I></A></B></TD>
<TD>An interface representing a text message Object instances implementing this interface are just containers for the data that is passed in. </TD>
</TR>
</TABLE>
<P>
<A NAME="package_description"><!-- --></A><H2>
Package com.nokia.mid.messaging Description
</H2>
<P>
<h3>Sending and receiving messages</h3>
<p>As usual with the Generic Connection Framework, the message sending and receiving functionality is implemented by a Connection interface, in this case MessageConnection.</p>
<p>The application obtains an object implementing the MessageConnection from the Connector class by providing a URL like string that identifies the address.</p>
<p>If the application specifies an full address that defines a recipient to the Connector, it gets a MessageConnection that works in a 'client' mode. This kind of Connection can only be used for sending messages to the address specified when creating it.</p>
<p>The application can create a 'server' mode MessageConnection by providing a URL string that includes only an identifier that specifies the messages intended to be received by this application. Then it can use this MessageConnection object for receiving and sending messages.</p>
<p>The MessageConnection object provides also factory methods for creating Message objects for sending.</p>
<p>For receiving messages, the MessageConnection supports also an event listener based receive mechanism, in addition to synchronous blocking receive() method.</p>
<p>Note that the methods for sending and receiving messages may throw a SecurityException. This is thrown if the application does not have the permission for those operations. The end user is prompted to give a permission to send messages. Sending messages to certain reserved port numbers is prohibited and will throw a SecurityException always.</p>
<h3>GSM SMS message structure</h3>
<p>The GSM SMS messages are defined in the GSM 03.40 standard [1]. The message consists of a fixed header and a field called TP-User-Data that carries the payload of the short message as well as optional header information that is not part of the fixed header. The optional headers are contained in a field called User Data Header and the presence of such headers in the TP-User-Data field is indicated in a separate field that is part of the fixed header.</p>
<p>The TP-User-Data can be encoded using different encodings depending on the type of the payload content. Possible encodings are a 7-bit alphabet defined in the GSM 03.38 standard, 8-bit binary data or 16-bit UCS-2 alphabet.</p>
<p>The maximum length of the one SMS protocol message payload depends on the encoding and whether there are optional headers present in the TP-User-Data field. This Java API uses the port numbers to distinguish to which application a message is targeted at, when sending messages that are intended to be received by a Java application instead of them being displayed to the end user as usual. The presence of the optional header for the port number causes the payload that fits into the SMS protocol message to be smaller.</p>
<p>The messages that the Java application sends may be longer than fits in a single SMS protocol message. In this case, the implementation uses the concatenation feature specified in sections 9.2.3.24.1 and 9.2.3.24.8 of the GSM 03.40 standard for splitting the payload of the message given to the Java API into multiple SMS protocol messages. Similarly, when receiving messages, the implementation concatenates automatically the received SMS protocol messages and passes the full reassembled payload to the application via the API.</p>
<p>Implementations of this API shall support at least 3 SMS protocol messages to be received and concatenated together. Similarly for sending, messages that can be sent with up to 3 SMS protocol messages shall be supported. Depending on the implementation, these limits may be higher. However, applications are advised not to send messages that will take up more than 3 SMS protocol messages, unless they have reason to assume that the recipient will be able to handle a larger number.</p>
<p>The following table gives the number of SMS protocol messages for each payload length in each case:</p>
<table border=1>
<tr>
<td>
Optional headers<br/>
Encoding
</td>
<td colspan=2>
No port number present <br/>
(message to be displayed to the end user)
</td>
<td colspan=2>
Port number present<br/>
(message targeted at an application)
</td>
</tr>
<tr>
<td>
</td>
<td>
Length
</td>
<td>
SMS messages
</td>
<td>
Length
</td>
<td>
SMS messages
</td>
</tr>
<tr>
<td rowspan=3>
GSM 7-bit alphabet
</td>
<td>
0...160 chars
</td>
<td>
1
</td>
<td>
0...152 chars
</td>
<td>
1
</td>
</tr>
<tr VALIGN=TOP>
<td>
161...304 chars
</td>
<td>
2
</td>
<td>
153...290 chars
</td>
<td>
2
</td>
</tr>
<tr>
<td>
305...266 chars
</td>
<td>
3
</td>
<td>
291...435 chars
</td>
<td>
3
</td>
</tr>
<tr>
<td rowspan=3>
8-bit binary data
</td>
<td>
0...140 bytes
</td>
<td>
1
</td>
<td>
0...133 bytes
</td>
<td>
1
</td>
</tr>
<tr>
<td>
141...266 bytes
</td>
<td>
2
</td>
<td>
134...254 bytes
</td>
<td>
2
</td>
</tr>
<tr>
<td>
267...399 bytes
</td>
<td>
3
</td>
<td>
255...381 bytes
</td>
<td>
3
</td>
</tr>
<tr>
<td rowspan=3>
UCS-2 alphabet
</td>
<td>
0...70 chars
</td>
<td>
1
</td>
<td>
0...66 chars
</td>
<td>
1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -