Java Reference
In-Depth Information
You perform the actual communication using the Connection interface subclass that
Connector.open returns; it typically provides a means for you to obtain either streams or
datagrams that you use to exchange bytes with the remote side of the connection. Most
subclasses of Connection provide additional methods for performing protocol-specific
operations, such as setting socket options.
An important example of a Connection interface subclass is the hierarchy that begins
with ContentConnection and contains HttpConnection ; you use these two classes to perform
HTTP exchanges with remote web servers to obtain content and interact with remote
web services. Using just the HttpConnection , you can post data to a remote server in URL-
encoded form and obtain a response that your application can parse, store, and display;
you can do the same over HTTPS using the HttpsConnection .
When running on the CLDC MIDP platform, your application requires privilege in
order to establish a connection. Untrusted applications prompt the user for permission
to establish a connection; trusted applications can indicate their need for access to a spe-
cific connection type through the JAD attributes MIDlet-Permissions and
MIDlet-Permissions-Opt .
 
Search WWH ::




Custom Search