Beruflich Dokumente
Kultur Dokumente
Objectives
In this lesson, you will learn to:
Identify the types of wireless technologies Identify the need for J2ME Identify the goals and characteristics of JTWI specification Identify the MIDlet development lifecycle Execute a MIDlet by using NetBeans 5.5.1
NIIT
Lesson 1A / Slide 1 of 22
NIIT
Lesson 1A / Slide 2 of 22
There are various types of wireless technologies, all of which have different capabilities and unique applications. Most of the wireless technologies are based on the Global System for Mobile Communications (GSM) platform. The various wireless technologies are: General Packet Radio Service (GPRS) Third Generation GSM (3GSM) Enhanced Data rates for GSM Evolution (EDGE) Wireless Application Protocol (WAP)
NIIT
Lesson 1A / Slide 3 of 22
GPRS
GPRS is a data service used to send and receive data across the wireless network. 3GSM is an enhanced version of the GSM platform that provides third generation mobile multimedia services. EDGE technology enables mobile users to download video and music clips and access high-speed Internet. WAP is a specification that adapts several data-handling techniques used by Web protocols, such as TCP/IP.
3GSM
EDGE
WAP
NIIT
Lesson 1A / Slide 4 of 22
Introducing J2ME
Java 2 Platform Micro Edition (J2ME) is a Java-based platform developed by Sun Microsystems. J2ME is used to create mobile applications that are used in mobile devices having limited processor, memory, and display capabilities. This platform includes flexible user interfaces, a robust security model, and built-in network protocols.
NIIT
Lesson 1A / Slide 5 of 22
Evolution of J2ME
The versions of Java have been released in a series. This has led to the Java platform being split into the following three editions:
Java 2 Standard Edition (J2SE) Is primarily used to create Java applets and applications that are stand alone and Web-based. Java 2 Enterprise Edition (J2EE) Contains all the functionality of J2SE and focuses on server programming by using EJB, Servlets and JSP, and XML. Java 2 Micro Edition (J2ME) Focuses on the wireless computing environment.
NIIT
Lesson 1A / Slide 6 of 22
The three layers in the J2ME platform are: Kilobytes Virtual Machine (KVM) Layer Represents a virtual machine similar to the Java Virtual Machine (JVM).
Configuration Layer Defines class libraries for a range of devices that have similar requirements. Profile Layer Defines class libraries for a narrower category of devices within the framework of a chosen configuration.
Lesson 1A / Slide 7 of 22
NIIT
Why J2ME
Mobile devices support downloading of wireless applications and running them on a mobile device to ensure wireless Internet access. Such wireless applications can be created by using mobile application development languages such as J2ME. The benefits of the J2ME platform are: Security Performs a class file verification procedure on the J2ME applications before downloading them on a mobile device.
NIIT
Lesson 1A / Slide 8 of 22
Dynamic content delivery Specifies that J2ME applications provide some services and content that can be downloaded over different types of wireless network, such as GSM and CDMA.
Enhanced User Interface (UI) and interactive content Provides packages such as javax.microedition.lcdui to enhance the UI and graphic capabilities in mobile devices.
Offline access Enables the use mobile applications without maintaining a constant connection with the wireless network.
NIIT
Lesson 1A / Slide 9 of 22
The Java Technology for the Wireless Industry (JTWI) specification defines a standard for the J2ME runtime environment to deploy mobile applications for various mobile devices. JTWI was formulated by a group of experts from organizations such as Motorola, Nokia, and Siemens. This group is called the Java Community Process (JCP) expert group JSR185. JTWI-compliant devices should include APIs, such as CLDC 1.0 and MIDP 2.0, as specified by the JTWI specification. These specifications serve as a standard for developing mobile devices that can transmit information on standardized frequencies.
Developing Mobile Applications Using Java Lesson 1A / Slide 10 of 22
NIIT
To standardize the APIs used in mobile devices. It also provides: Hardware specifications for mobile device manufacturers. Frequency specifications for mobile device operators. API specifications for application developers. To improve the interoperability and compatibility of Java enabled mobile devices. To reduce the time and cost of enabling J2ME wireless technology in mobile devices.
NIIT
Lesson 1A / Slide 11 of 22
Mandatory specifications: Include a set of specifications that need to be implemented in a JTWI compliant mobile device. Conditionally required specifications: Specify that a JTWI compliant device should fulfill one or more mandatory conditions. Minimum Configuration Specifications: Includes specifications for the virtual machine and a set of APIs that are required for the J2ME runtime environment.
NIIT
Lesson 1A / Slide 12 of 22
Understanding MIDlets
Applications that are developed by using J2ME APIs are called MIDlets. MIDlets are similar to Java applets. Following are some differences between MIDlets and applets: An applet is a Java class file embedded into an HTML page. A MIDlet is a Java class file packaged into a JAD (Java descriptor) file. An applet runs in a Web browser. A MIDlet runs in an Application Management Software (AMS) that is already installed on MIDP devices. An applet is viewed in a browser or applet viewer tool. A MIDlet is viewed on handheld devices that support CLDC and MIDP. A MIDlet cannot use classes or interfaces other than those provided by CLDC and MIDP APIs.
Developing Mobile Applications Using Java Lesson 1A / Slide 13 of 22
NIIT
Paused state MIDlet is paused when a call comes in to the mobile device. Destroyed state MIDlet life cycle ends when the MIDlet is destroyed.
NIIT
Lesson 1A / Slide 14 of 22
Running and monitoring Enables you to run and debug the MIDlets on a desktop computer by using the J2ME emulator before actually deploying the MIDlet on a mobile device. MIDlet suite signing Contains tools for cryptographically signing the MIDlets.
Lesson 1A / Slide 15 of 22
NIIT
The Sun Java Wireless Toolkit contains the following two tools to build and test J2ME applications in a simulated environment:
Wireless Toolkit Wireless Toolkit is a development environment for developing MIDlets. Emulator The emulator provides an efficient simulated environment to test the code on a PC.
NIIT
Lesson 1A / Slide 16 of 22
Problem Statement
Steve has recently joined the SkyBlue service provider as a Wireless developer. He is assigned the task to create a new mobile application by using J2ME. For this, Steve needs to install NetBeans 5.5.1 along with the Mobility pack on his computer. Steve also needs to check whether the installation is performed correctly by running a sample application.
NIIT
Lesson 1A / Slide 17 of 22
Solution
To solve the preceding problem, Steve needs to perform the following tasks: 1. Install the NetBeans 5.5.1. 2. Install the NetBeans Mobility Pack 5.5.1. 3. Run the sample application.
NIIT
Lesson 1A / Slide 18 of 22
Summary
In this lesson, you learned:
The various technologies used in wireless communication are: GPRS: Is a data service that sends and receives information across a mobile telephone network. 3GSM: Is an enhanced standard of the GSM platform that provides third generation mobile multimedia services. EDGE: Is a 3G wireless technology that provides broad bandwidth and faster data transfer, as compared to the 2G wireless technology, in mobile devices. WAP: Is a protocol for browsing the Web on a mobile device.
NIIT
Lesson 1A / Slide 19 of 22
Summary (Contd.)
The benefits of using J2ME to develop wireless applications are: Security Cross platform compatibility Dynamic content delivery Enhanced User Interface (UI) and Interactive content Offline access The J2ME architecture defines three layers of software, KVM, Configuration Layer, and Profile layer. The Java Technology for the Wireless Industry (JTWI) specification defines a standard for the J2ME runtime environment to deploy mobile applications for different mobile devices.
NIIT
Lesson 1A / Slide 20 of 22
Summary (Contd.)
The JTWI specification defines three categories of device level specifications: Mandatory Specifications Conditionally Required Specifications Minimum Specifications MIDlets are programs that are developed for mobile devices. MIDlets are developed by using the J2ME APIs. The various states of a MIDlet life cycle are: Active state: Initializes a MIDlet. Pause state: Pauses a MIDlet. Destroy state: Destroys a MIDlet.
NIIT
Lesson 1A / Slide 21 of 22
Summary (Contd.)
Sun Java Wireless Toolkit is a set of tools that you can use to create applications for mobile devices. The two tools in Sun Java Wireless Toolkit are: Wireless Toolkit Emulator
NIIT
Lesson 1A / Slide 22 of 22