Escolar Documentos
Profissional Documentos
Cultura Documentos
Chapter 1
Mobile Application Development
1.1 Objectives
In this chapter, we will discuss the characteristics of mobile devices, and how it influence the
development program for this device. We will be introduced the Java 2 Mobile Edition (J2ME),
including the importance of configuration and profile.
At the end of the lesson, the student should be able to:
Small in size
Mobile device has a small size. Consumers want the smallest device for their convenience
and mobility.
Limited memory
The mobile device also has a small memory, namely primary (RAM) and secondary (disk).
This restriction is one of the factors that influenced the writing program for various types
of these devices. With restrictions on the amount of memory, special considerations must
be taken to maintain the use of this expensive resource
J.E.N.I.
Mobile devices spend less power compared to a desktop machine. This device should save
power because they run on the circumstances in which limited power provided by the
batteries.
Limited connectivity
The mobile device has a low bandwidth, some of them do not even connected. Most of
them use a wireless connection.
Desktop applications
Mobile devices
JavaCard
Smart Cards
J.E.N.I.
Servers
Desktop
machines
High-end
consumer
devices
Optional
Packages
Optional
Packages
Low-end
consumer
devices
Smart
Cards
J2EE
J2SE
Personal Profile
Foundation Profile
MIDP
CDC
CLDC
Java
Card
KVM
Card VM
Figure 1: Java
Platform
J.E.N.I.
Applications
Profile
Configuration
Optional
OEM
Packages
APIs
Libraries
{
Java Virtual Machine
Figure 2: J2ME
Architecture
A profile provides additional libraries for a particular class at a device. Profile-profile provides a
user interface (UI) API, persistence, messaging library, etc.
A set of additional libraries or additional package provides the ability to program additional. This
package entered into J2ME devices may vary as depending on the capabilities of a device. For
example, some devices MIDP does not have Bluetooth built-in, so the Bluetooth API is not
provided in this device.
1.3.3 Configuration
A minimal configuration describe the features of a complete Java runtime environment. To ensure
portability and interoperability capabilities between different optimal kinds of devices are limited
resources (memory, processor, connections are restricted), configuration no describe features
additional. Something configuration J2ME describes a minimum complement of JAVA technology.
It is a profile-profile task to describe the additional libraries for a category of devices certain.
Configuration illustrates:
J.E.N.I.
1.3.4 Profiles
A profile defines additional sets of APIs and features for a particular market, device category or
industry. While a configuration defines the base libraries, profiles define the libraries that are
important to make effective applications. These libraries include the user interface, networking,
and storage APIs.
1.4 CLDC
The Connected Limited Device Configuration (CLDC) describes and refers to the area the
following:
Input/Output (java.io.*)
Security
Networking
Internationalization
Asynchronous exceptions
Reflection
Reflection, Java Native Interface (JNI) and user-defined class loaders potential into breach
security. JNI also require intensive memory so it is possible to not the support of the lower
memory a mobile device.
At least 192kb of memory for Java platform (160kb non-volatile memory for VM and
libraries and 32kb volatile memory for VM runtime).
16 or 32 bit processor.
J.E.N.I.
CLDC does not describe the installation and life cycle of an application, interface (UI) and event
handling (event handling). It is the mission profile which are under CLDC to describe this area.
In particular, the MIDP specification describes the cycle life MIDP application (MIDlet), UI library
and event handling (javax.microedition.lcdui. *).
File.java
compile (javac)
Install
verify
(runtime)
File.class
preverify
interpret
File.class
Development Machine
Figure 3: Two Levels
Target Device
Process Verification
J.E.N.I.
Connection
StreamConnectionNotifier
DatagramConnection
InputConnection
OutputConnection
StreamConnection
ContentConnection
connection
1.5 CDC
Connected Device Configuration (CDC) is a super set of the CLDC. CDC provides Java runtime
environment that is broader than the CLDC and closer to J2SE environment.
J.E.N.I.
CDC Java Virtual Machine (CVM) fully supports the Java Virtual Machine (JVM). CDC lists all of
the CLDC API. CDC provides a larger subset of all class J2SE.
As CLDC, CDC does not describe every class UI. UI Library is described by profile- profile under
this configuration.
All classes contained in the CDC comes from this package:
java.io
java.lang
java.lang.ref
java.lang.math
java.net
java.security
java.security.cert
java.text
java.util
java.util.jar
java.util.zip
CDC also incorporated inside the GCF. CDC requires additional connection types such as file and
support datagram.
1.6 JTWI
The Java Technology for the Wireless Industry (JTWI) establishes a set of services and
specifications standard. Based JTWI specification, the key word is "to minimize fragmentation API
in in market telephone mobile, and for send specification that could predictable, clear specification
for the plant, operators and application developers."
With adjustments to JTWI, many applications will run in a broader set on the device. The device
will also plant lucky because a large application will be available for their devices.
J.E.N.I.
MIDlets
MIDP 2.0
WMA
1.1
MMAPI Optional
1.1
Packages
OEM
APIs
1.7 MIDP
The Mobile Information Device Profile (MIDP) was on top of the CLDC. You cannot write mobile
applications using only the CLDC API. You must keep utilize MIDP defines the UI.
Specifications MIDP, CLDC and most other APIs such as already illustrated through Java
Community Process (JCP). JCP involves a group of experts from more than 50 Companies, which
consists of a mobile device manufacturer, software developer. MIDP continue developing, with
future versions that have passed rigorous process JCP.
MIDP specification describes a MID device that has characteristicsThese characteristics as a minimum:
Display:
Screen-size: 96x54
Display depth: 1-bit
Pixel aspect ratio: approximately 1:1
Input:
Memory:
256 kilobytes of non-volatile memory for the MIDP implementation, beyond what's
required for CLDC.
8 kilobytes of non-volatile memory for application-created persistent data
128 kilobytes of volatile memory for the Java runtime (e.g., the Java heap)
Networking:
Two-way, wireless, possibly intermittent, with limited bandwidth
Sound:
The ability to play tones, either via dedicated hardware or via software algorithm.
J.E.N.I.
Describe MIDP application model, UI API, storage and strong networks, games and media APIs,
security policies, application deployment and provision of over-the- water.
1.8 MIDlet
A MIDP application is called a MIDlet. The device's application management software (AMS)
interacts directly with the MIDlet with the MIDlet's create, start, pause, and destroy methods.
The MIDlet is part of the javax.microedition.midlet package. A MIDlet must extend the MIDlet
class. It can request parameters from the AMS as defined in the application descriptor (JAD).
A MIDlet does not have (and MUST NOT have) a public static void main(String[] argv) method.
It will not be recognized by the AMS as the program's starting point.
MIDlet into the status "Active" on the startup method call () by AMS.
MIDlet into the status of "Destroyed" when AMS destroyApp invoke (). This status also reaccessed when method notifyDestroyed () returned successfully to the application. Note that the
MIDlet can only enter the status of "Destroyed" once in their lifetime.
10
J.E.N.I.
new
destroyApp()
startApp()
Paused
Destroyed
Active
pauseApp()
destroyApp()
1.9 Exercises
1.9.1 What are the advantages of using Java as the development and
platform runtime for mobile devices??
dynamic applications
11
J.E.N.I.
Pleasure factors
12