- Forward


The J2ME Connection Framework
and Related Topics


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Using the Decorator Pattern
Back Forward

Add Capabilities to an Object Dynamically

images/decorator_pattern.gif
Input/Output Streams
Back Forward
images/j2me-io.gif
The Connection Framework
Back Forward
  • Packages:
    • Mostly in the package javax.microedition.io
    • Some connections are in optional packages
  • States:
    • Setup
    • Connected
    • Closed
The Connection Framework (cont.)
Back Forward
images/j2me-connection-framework.gif
Schemes and Connection Types
Back Forward
  • btltcap for L2CAPConnection (JSR82)
  • datagram for UDPDatagramConnection (MIDP2.0)
  • file for FileConnection (JSR75)
  • http for HttpConnection (MIDP1.0)
  • https for HttpsConnection (MIDP2.0)
  • sms for MessageConnection (JSR120)
  • socket for SocketConnection (MIDP2.0)
  • serversocket for ServerSocketConnection (MIDP2.0)
Opening a Connection
Back Forward
SocketConnection c = (SocketConnection)Connector.Open("socket://cs.jmu.edu:8120");
UDPDatagramConnection c = (IDPDatagramConnection)Connector.Open("datagram://cs.jmu.edu:8120");
HttpConnection c = (HttpConnection)Connector.Open("http://www.jmu.edu");
FileConnection c = (FileConnection)Connector.Open("file://test.txt");
There's Always More to Learn
Back -