Motorola i88s manual TCP Sockets, SSL Secure Sockets, ServerSockets

Page 17

Motorola Inc.

i88s J2ME Developers’ Guide

In this particular example, the standard port 443 is used, but this parameter can be specified as shown in the following example:

HttpConnection hc = (HttpConnection)Connector.open(“http://www.motorola.com:8888”);

The other static Connector methods work in the same manner, but they provide the application additional control in dealing with the properties of the connection.

Note – Only Verisign Certificates are supported in the i88s phone. The following is a list of supported features:

SSL 3.0

TLS 1.0

Server Authentication

2.2.3TCP Sockets

The low-level socket used to implement the higher-level HTTP protocol is exposed to applications via the Generic Connection Framework. The usage is similar to the examples above, however, a StreamConnection is returned by the Connection.open() method, as shown in the following example:

StreamConnection sc = (StreamConnection)Connector.open(“socket://www.motorola.com:8000”);

Although similar to HTTP, notice the required port number at the end of the remote address. In the previous protocols, those ports are well known and registered so they are not required, but in the case of low level sockets, this value is not defined. The port number is a required parameter for this protocol stack.

2.2.4SSL Secure Sockets

The low-level socket used to implement the higher-level HTTPS protocol is also exposed to applications via the Generic Connection Framework. The usage is similar to the examples above.

StreamConnection sc = (StreamConnection)Connector.open(“ssocket://www.motorola.com:8000”);

As with non-secure sockets, the port number is a required parameter for this protocol stack.

2.2.5ServerSockets

In addition to acting as a data requestor, some applications may act as data providers or servers. In order to accomplish this without workarounds or polling, a server type socket is required. The i88s phone provides this functionality within the GenericConnectionFramework. Opening a ServerSocket via the Connector object

Version 1.0 - Page 17

Image 17
Contents I88s Multi-Communication Device J2ME Developers’ Guide J2ME Networking Disclaimer Document OverviewAcronyms Used In This Guide Terminology Definition Contact InformationAcronyms and Definitions Overview Agps On The i88s PhoneAssist Data Position APIAccuracy Example PositionConnection ClassAlmanac Out Of Date Retrieving Position in Java Method DescriptionsGetPosition GetPositionString nameGetStatus Using Position in JavaExample Using PositionConnection Positionresponsenoalmanacoverride Addition, to obtain better accurate speed and direction Recommendation Http Https J2ME NetworkingClass Descriptions Supported Protocols on the i88s Phone HttpHttps ServerSockets TCP SocketsSSL Secure Sockets UDP Sockets Serial Port AccessCommunicating on a Port Connection Optional ParametersImplementation Notes Example using StreamConnectionConcurrent Connections For The i88s Phone Protocol Maximum TipsMethod Descriptions Opening a file File I/OClass Description Code Examples Deleting a fileReading and Writing Example # 2 Complete MIDlet code Motorola Inc I88s J2ME Developers’ Guide Os = sc.openOutputStream //get InputStream Sc.close Caveats Motorola Inc I88s J2ME Developers’ Guide
Related manuals
Manual 43 pages 17.94 Kb