+ All Categories
Home > Technology > J2ME Unit_01

J2ME Unit_01

Date post: 17-Aug-2015
Category:
Upload: prashanth-shivakumar
View: 64 times
Download: 0 times
Share this document with a friend
Popular Tags:
22
Lesson 1A / Slide 1 of 22 Developing Mobile Applications Using Java 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
Transcript

Lesson 1A / Slide 1 of 22Developing Mobile Applications Using Java

ObjectivesIn 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

  

Lesson 1A / Slide 2 of 22Developing Mobile Applications Using Java

Introduction to Wireless Technologies • Wireless technology is a term used to describe a network where there is no

physical connection between the sender and receiver.

• Wireless technologies are being adopted for many new applications, such as:

• Connecting computer

• Remote monitoring

• Data acquisition and security

• Providing solutions for environments where wires may not be the best solution

• There are many wireless network based products available today, such as mobile phones, PDA devices, pocket PCs, and digital diaries.

• Wireless technologies provide a medium to communicate and create wireless applications.

Lesson 1A / Slide 3 of 22Developing Mobile Applications Using Java

Identifying Types of Wireless Technologies

• 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)

Lesson 1A / Slide 4 of 22Developing Mobile Applications Using Java

Identifying Types of WirelessTechnologies (Contd.)

• GPRS

• GPRS is a data service used to send and receive data across the wireless network.

• 3GSM

• 3GSM is an enhanced version of the GSM platform that provides third generation mobile multimedia services.

• EDGE

• EDGE technology enables mobile users to download video and music clips and access high-speed Internet.

• WAP

• WAP is a specification that adapts several data-handling techniques used by Web protocols, such as TCP/IP.

Lesson 1A / Slide 5 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 6 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 7 of 22Developing Mobile Applications Using Java

Evolution of J2ME (Contd.)The J2ME classes are a subset of J2SE classes.

• J2ME is a simplified version of J2SE and contains classes and methods to develop applications for mobile devices.

• 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 8 of 22Developing Mobile Applications Using Java

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.

• Cross platform compatibility

• Provides standardized language features and libraries.

Lesson 1A / Slide 9 of 22Developing Mobile Applications Using Java

Why J2ME (Contd.)• 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.

Lesson 1A / Slide 10 of 22Developing Mobile Applications Using Java

Describing JTWI Specification• 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 JSR-185.

• 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.

Lesson 1A / Slide 11 of 22Developing Mobile Applications Using Java

Identifying Goals of JTWI Specification• The goals set for JTWI specification are:

• 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.

Lesson 1A / Slide 12 of 22Developing Mobile Applications Using Java

Characteristics of JTWI Specifications• The JTWI specification defines three categories of J2ME specifications:

• 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.

Lesson 1A / Slide 13 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 14 of 22Developing Mobile Applications Using Java

Explaining MIDlet Lifecycle• A MIDlet, similar to an applet, undergoes various changes in its state.

• The states of the MIDlet life cycle are:

• Active state

• MIDlet life cycle begins when it is launched in a mobile device.

• 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.

Lesson 1A / Slide 15 of 22Developing Mobile Applications Using Java

Describing Sun Java Wireless Toolkit• Sun Java Wireless Toolkit is a set of tools that you can use to create

applications for mobile and other wireless devices.

• The functions of Sun Java Wireless Toolkit are:

• Building and packaging

• Compiles the source code, pre-verifies the class files, and packages the MIDlets.

• 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 16 of 22Developing Mobile Applications Using Java

Describing Sun Java Wireless Toolkit(Contd.)

• 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.

Lesson 1A / Slide 17 of 22Developing Mobile Applications Using Java

Demonstration-Installing and UsingNetBeans 5.5.1

• 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.

Lesson 1A / Slide 18 of 22Developing Mobile Applications Using Java

Demonstration- Installing and UsingNetBeans 5.5.1 (Contd.)

• 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.

Lesson 1A / Slide 19 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 20 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 21 of 22Developing Mobile Applications Using Java

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.

Lesson 1A / Slide 22 of 22Developing Mobile Applications Using Java

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


Recommended