Overview of Networking

Chapter 4 - Networking

    Overview of Networking

  • Overview

              The wireless devices such as cell phones and two-way pagers keep their owners connected to the outside world at anytime from anywhere.It offer connectivity that other types of devices not used.

    The J2ME Generic Connection Framework

              The networking is flexible for variety of devices and has to be very device specific at the same time.

              The Generic Connection framework is first introduced in the CLDC.The Generic Connection framework is to define the abstractions of the networking and file I/O as general as possible to support a broad range of handheld devices.

              There is 1 class (Connector) and 7 connection interfaces (Connection, ContentConnection, DatagramConnection, InputConnection, OutputConnection, StreamConnection, and StreamConnectionNotifier) defined in the Generic Connection framework.

              javax.microedition.io package that comes with J2ME CLDC.There is no implementation of the connection interfaces at the CLDC level. The actual implementation is left to MIDP.

              The 7 connection interfaces define the abstractions of 6 basic types of communications:

              basic serial input, basic serial output, datagrams communications, sockets communications, notification mechanism in a client-server communication, and basic HTTP communication with a Web server.

              Connection is an interface and the root of the connection interface hierarchy. All the other connection interfaces derive from Connection.

              StreamConnection derives from InputConnection and OutputConnection.It defines both the input and output stream connection.

              ContentConnection derives from StreamConnection. It adds three additional methods from MIME handling on top of the I/O methods in StreamConnection.

              The Connector class is the core of Generic Connection framework.The static method open defined in Connector class.

              Different types of communication can be created by the same method with different parameters.

              The connection could be file I/O, serial port communication, datagram connection, or an http connection depending on the string parameter passed to the method.

    Method:
    Connector.open(String connect); 

              The parameter connect_is a String variable. It has a URL-like format: {protocol}:[{target}][{params}] and it consists of three parts: protocol, target, and params.

              There are several possible values for protocol: file, socket, comm, datagram and http. file indicates that the connection will be used for file I/O, comm indicates that the connection will be used for serial port communication, and http indicates that the connection is created for accessing web servers.

© 2015 by Learncertification All Rights Reserved. The certification names are the trademarks of their respective owners. Terms & Privacy Policy