J2ME Messaging Khanh Le. Objective  The objective of wireless messaging is to extend the networking and I/O capabilities of J2ME applications to send.

Slides:



Advertisements
Similar presentations
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
1 Semester 2 Module 4 Learning about Other Devices Yuda college of business James Chen
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Introduction to push technology © 2009 Research In Motion Limited.
UNDERSTANDING JAVA APIS FOR MOBILE DEVICES v0.01.
Network Programming Chapter 11 Lecture 6. Networks.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
UDP - User Datagram Protocol UDP – User Datagram Protocol Author : Nir Shafrir Reference The TCP/IP Guide - ( Version Version.
1 Java Networking – Part I CS , Spring 2008/9.
CSCI 4550/8556 Computer Networks Comer, Chapter 3: Network Programming and Applications.
Java Socket Support Presentation by: Lijun Yuan Course Number: cs616.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Developing J2ME Applications Mobile and Wireless Networks.
Chapter 23: ARP, ICMP, DHCP IS333 Spring 2015.
V0.01 © 2009 Research In Motion Limited Push technology for Java applications Trainer name Date.
The OSI Model A layered framework for the design of network systems that allows communication across all types of computer systems regardless of their.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Communicating over the Network Network Fundamentals – Chapter 2.
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
Connecting LANs, Backbone Networks, and Virtual LANs
The University of New Hampshire InterOperability Laboratory Serial ATA (SATA) Protocol Chapter 10 – Transport Layer.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
An Introduction to the Java ME Project Jens A Andersson.
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
85/06/15 Mahdi Niamanesh 1 Messaging Future Mahdi Niamanesh Sharif Univ. of Technology 85/08/10.
Computer Networks  Network - A system of computers interconnected in order to share information.  Data transmission - consists of sending and receiving.
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
CCNA 1 v3.0 Module 9 TCP/IP Protocol Suite and IP Addressing
Java Mobile Application sms,sim,mms and barcode application Presented by Ayedh(SIM and MMS) Asad(SMS and Barcode Application)
Introduction to BlackBerry Smartphone Web Development —Introduction to Browser Push Trainer name Date V1.00 © 2009 Research In Motion Limited.
Characteristics of Communication Systems
Hyung-Min Lee©Networking Lab., 2001 Chapter 11 User Datagram Protocol (UDP)
Mobile Technologies Introduction Basics of GSM Value Added Services SMS Short Codes Asterisk * LBS.
LWIP TCP/IP Stack 김백규.
Chapter 7 Low-Level Protocols
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
GSM Network Structure Lance Westberg.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
FTP Client Application CSC 8560 Brian Jorgage 4/27/2004.
Mobile Communication The SMS implies of several additional elements in the network architecture There is also another Element called.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
The Socket Interface Chapter 22. Introduction This chapter reviews one example of an Application Program Interface (API) which is the interface between.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
© 2009 Research In Motion Limited Advanced Java Application Development for the BlackBerry Smartphone Trainer name Date.
GPRS functionality overview in Horner OCS. GPRS functionality – Peer to Peer communication over GPRS – CSCAPE connectivity over GPRS – Data exchange using.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Network Architecture Protocol hierarchies Design Issues for the layers
1 Layer 2 Technologies Honolulu Community College Cisco Academy Training Center Semester 1 Version
Hour 6 The Transport Layer 1. What You'll Learn in This Hour Connections oriented and connectionless protocols Ports and sockets TCP UDP 2.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
DWAN ALSTON SMS TECHNOLOGY WHAT IS SMS????? SMS stands for Short Message Service. It is a technology that enables the sending and receiving of messages.
1 Network Communications A Brief Introduction. 2 Network Communications.
SPL/2010 Reactor Design Pattern 1. SPL/2010 Overview ● blocking sockets - impact on server scalability. ● non-blocking IO in Java - java.niopackage ●
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Transport Layer.
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Wednesday, September 19, 2018 What Is the Internet?
Chapter 3: Open Systems Interconnection (OSI) Model
Message Service System
CS4470 Computer Networking Protocols
Computer Networks Protocols
Transport Layer 9/22/2019.
Exceptions and networking
Short messaging service in GSM
Presentation transcript:

J2ME Messaging Khanh Le

Objective  The objective of wireless messaging is to extend the networking and I/O capabilities of J2ME applications to send and receive messages using the messaging services on GSM networks, like Short Message Service (SMS) and Cell Broadcast Service (CBS).

The Wireless Messaging System - an overview  The notion of wireless messaging provides a whole new vista to J2ME. J2ME applications powered by wireless messaging have a platform-independent access to wireless communication resources like Short Message Service (SMS) and Cell Broadcast Service (CBS) for Global System for Mobile Communication (GSM) Networks, a mobile telephony system permitting inter- country communication.  Before proceeding with the details on how J2ME Wireless Messaging works, I will discuss, in short, the SMS and CBS messaging systems in a GSM Network.

GSM Short Message Service (SMS)  SMS is the transmission of short text messages to and from a mobile phone, fax machine, and/or IP address in a GSM network.  Messages must be no longer than 160 alphanumeric characters and contain no images or graphics.  The main features of this service are speed, cheap rates, and the guarantee that the message will reach the target person, even if he is out of radio coverage or his phone is turned off.

GSM Short Message Service (SMS)  Once a message is sent, it is received by a Short Message Service Center (SMSC), which must then get it to the appropriate mobile device.  To do this, the SMSC sends a SMS request to the home location register (HLR) to find the roaming customer. Once the HLR receives the request, it will respond to the SMSC with the subscriber's status, as in 1) inactive or active, and 2) roaming location.

GSM Short Message Service (SMS)  If the response is inactive, then the SMSC will hold onto the message for a period of time.  When the subscriber accesses his device, the HLR sends a SMS notification to the SMSC, and the SMSC attempts delivery.  The SMSC transfers the message to a GSM message delivery system in a Short Message Delivery Point-to- Point format. The system pages the device and, if it responds, delivers the message.  The SMSC receives verification that the message was received by the end user, and then categorizes the message as sent and will not attempt to send it again.

GSM Short Message Service (SMS)

GSM cell broadcast service  The GSM cell broadcast service allows messages to be sent to every Mobile Station (MS), such as a mobile phone, fax machine, and/or IP address currently in a particular cell.  Cell broadcast messages are repeated at intervals over a period of time, which allows an MS to receive the message even if entering the cell after the first transmission.  The data can be sent either as binary data or ASCII text up to 15 pages in length, with a page being up to 93 characters in length; the test set only provides support for ASCII messages.  Cell broadcast messages are classified by topic and allocated a channel number, message code, update number, and language  While SMS is a one-to-one and one-to-few messaging system, CBS provides one-to-many messaging within a certain geographical area.

The wireless messaging system  This system can be viewed as a 3-tiered architecture, consisting of the Interface Layer, Implementation Layer and Transport Layer.  The Interface Layer constitutes a generic set of messaging interfaces, independent of any messaging protocol.  The Implementation Layer contains classes which implement each Interface Layer to access wireless messaging like SMS or CBS functionalities on a GSM mobile device..  The Transport Layer contains classes that are the actual implementation of protocols that carry messages to the mobile device.

The wireless messaging system

The Generic Messaging API, javax.wireless.messaging  This API defines all the interfaces for sending and receiving wireless messages. Following is a list of interfaces:  Message. This provides the basic definition of a message, which acts as a container holding address, payload, and flags to send and block for a message. It is a superinterface to TextMessage, a message object with a text payload attribute, and a BinaryMessage, a message object with a binary payload attribute.

The Generic Messaging API, javax.wireless.messaging  MessageConnection. This provides the basic functionality of receiving and sending messages. It contains a method for sending and receiving messages, a factory method for creating new Message objects, and a method that calculates the number of segments of the underlying protocol that are needed to send a specified Message object.  This class is instantiated by a call to Connector.open().

The Generic Messaging API, javax.wireless.messaging  In a client mode connection, messages can only be sent. A client mode connection is created by passing a string identifying a destination address to the Connector.open() method. This method returns a MessageConnection object.  clientConn = (MessageConnection)Connector.open("sms:// :5000");  In a server mode connection, messages can be sent or received. A server mode connection is created by passing a string that identifies an end point (protocol dependent identifier, for example, a port number) on the local host to the Connector.open() method.  serverConn = (MessageConnection)Connector.open("sms://:5000");  MessageListener. This provides a basic mechanism to notify the MIDlet application of an incoming message. It allows a MIDlet to receive a callback when new messages are available to be read.

The Short Message Service API  The com.sun.midp.io.j2me.sms package provides an API for the Short Message Service Messaging system and allows MIDlet to access SMS functionality on a GSM mobile device.  The main components of the package -- MessageObject and Protocol -- support the sending and receiving of SMS messages.

The Short Message Service API  MessageObject. MessageObject is the implementation of a SMS message. In the Implementation layer, the javax.wireless.messaging.Message interface is implemented as a buffer. The MessageObject handles the creation of message buffers and the input/output operations out of a buffer. Furthermore, it has two subclasses -- TextObject and BinaryObject. These classes implement a SMS message with a payload, whether text or binary.  Protocol. This implements the message connection to a low-level Transport mechanism required to transmit a SMS message. In the process, it checks for all runtime configuration parameters and handles exceptions related to invalid URL syntax, security violations, I/O violations, and illegal arguments. Protocol also handles the sending and receiving of messages using a datagram or serial port connection.

The Cell Broadcast Messaging API  The com.sun.midp.io.j2me.cbs package provides an API for the Cell Broadcast Messaging system and allows MIDLlet to access CBS functionality on a GSM mobile device.  The main component of the package, com.sun.midp.io.j2me.cbs.Protocol, supports the receipt of a CBS Message.  The CBS differs from SMS in that:  The URL Connection string does not support a designated host, and  It is meant for an inbound-only protocol. A MIDlet having CBS capability can receive messages, but cannot send them.

A J2ME messaging application  In this section, I will show an example of a WMAServer that waits for incoming SMS messages and then displays them on a phone screen. The javax.microedition.lcdui package provides a set of features for implementation of user interfaces for the applications.  The WMAServer MIDlet creates a server mode connection by passing a string that identifies an end point (protocol-dependent identifier -- like a port number, for example ) on the local host to the Connector.open() method.  In order to get notified of an incoming message, the MIDlet registers a MessageListener object at the MessageConnection instance, serverConn.  serverConn.setMessageListener(MessageListener ml);

A J2ME messaging application  It also implements notifyIncomingMessage() in the MessageListener interface. When an incoming message arrives at the MessageConnection, the notifyIncomingMessage() method is called. The application must retrieve the message using the receive() method of the MessageConnection.  The WMAServer application reads the payload data from the incoming message, whether text or binary, and stores it in a string object to be displayed later.

A J2ME messaging application public void notifyIncomingMessage(MessageConnection conn) { Message msg = null; // Try reading (maybe block for) a message try { msg = conn.receive(); } catch (Exception e) { // Handle reading errors System.out.println("processMessage.receive " + e); } // Process the received message if (msg instanceof TextMessage) { TextMessage tmsg = (TextMessage)msg; msgReceived = tmsg.getPayloadText(); } else { // process received message if (msg instanceof BinaryMessage) { BinaryMessage bmsg = (BinaryMessage)msg; byte[] data = bmsg.getPayloadData(); // Handle the binary message... msgReceived = data.toString(); } }

A J2ME messaging application  The application provides a destroyApp() method when the connection resources and associated listener objects must be released. public void destroyApp(boolean unconditional) { try { if (serverConn != null) { serverConn.setMessageListener(null); serverConn.close(); } } catch (IOException e) { // Handle the exception... e.printStacktrace(); }

A J2ME messaging application  Next is an example of a WMA client that sends a SMS message to a GSM mobile phone. The WMA Client can only send messages. It creates a MessageConnection by passing a string identifying a destination address (which is a valid mobile number) to the Connector.open() method. try { clientConn = (MessageConnection)Connector.open("sms:// :5000"); } catch (IOException ioExc) { System.out.println("Client connection could not be obtained"); ioExc.printStackTrace(); }

A J2ME messaging application  It then creates a valid TextMessage object by setting the payload and destination address and sends the message through the MessageConnection. TextMessage tmsg = (TextMessage)clientConn.newMessage (MessageConnection.TEXT_MESSAGE); tmsg.setAddress("sms:// :5000"); tmsg.setPayloadText(msgToSend); clientConn.send(tmsg);