You are on page 1of 5

Introduction to Mobile Application Development 062110

Monday, June 21, 2010


7:49 PM

Subject: ITE 1: Mobile Programming


Instructor: Sir K. Calpotura
Topic: Module 1: Introduction to Mobile Application Development
Date: 06.21.10

A. The Discussion
INTRO: The Platform
- The platform to use is J2ME ( Java 2 Micro Edition)
- Some requirements
○ Programmer should know the capabilities of the phone
○ Programmer should know the architecture
○ Programmer should know the Midlet life cycle
○ Programmer should know configurations and profiles

MAIN
1. CHARACTERISTICS OF MOBILE DEVICES
- Small in size
○ While high end phones today usually are quite big to accommodate touch screen, cameras and speakers, the
more common low-end phones are usually only about 3 in. long. The norm is that mobile phones be small is size
so that they are easier to carry around.
- Limited memory
○ Both primary and secondary memories are low.
○ The primary memory is volatile, or temporary storage. This means that when there is no power, all data in it
(RAM) is lost.
○ The secondary memory is non-volatile, or more of a permanent storage. It houses and keeps data even when it
has no power.
○ The device's small size could be a major factor as to why it has limited memory.
- Limited processing power
○ My (aging) humble notebook computer has an Intel Pentium dual-core processor (1.46 GHz, 533 MHz FSB, 1 MB
L2 cache). I think this basically means that my processor(s) can perform 1.46 million calculations per second. The
Front-side bus (FSB) rating, I think, refers to the speed of data transfer from the processor to and from the other
parts of the computer system. Cache memory ranks second in the hierarchy of memory in terms of speed, and
stores frequently accessed data. So I think a higher cache memory could also be a major factor in computer speed.
○ The preceding bullet contains some processor specs of a notebook that is about 10 in. x 14 in. However,
manufacturers could only fit so much in devices with such small sizes.
○ Mobile phones' processors are significantly less powerful than, say, a notebook computer.
- Low power consumption
○ Mobile devices are designed to conserve power because they run on a limited power supply (battery).
- Robust and reliable
○ These devices are carried along, by users. They're put inside bags, pouches, and even pockets. Therefore, they
must be able to withstand bumps, impacts, and the like.
- Limited connectivity
○ These devices usually have low bandwidth. This means that the transfer of data is much slower than that of
desktop or laptop counterparts.
- Short wake-up time
○ My notebook, when starting up from a full system shut down, would take more than a minute to load all it's
services.
○ My phone, however, requires only about 8 seconds for it to display the main interface, and about 2 seconds more
for it to be completely usable (access data stored on SIM: open phonebook, read inbox, etc.).
○ Consider also that most phones are kept on and seldom turned off. This characteristic sets these devices from
others.
- The mentioned characteristics could be both advantages or disadvantages.
- J2ME was designed with the capabilities of these devices in mind.

ITE 1 Page 1
2. J2ME OVERVIEW
- JAVA Platorms and the Virtual Machines that they use
Platform VirtualMachine
J2EE JVM
J2SE JVM
J2ME (high-end) JVM
J2ME (low-end) KVM
JavaCard CardVM
- Acronyms
○ J2EE - Java 2 Platform, Enterprise Edition
○ J2SE - Java 2 Platform, Standard Edition
○ J2ME -Java 2 Platform, Micro Edition
○ JVM - Java Virtual Machine
○ KVM - Kilo Virtual Machine
- What J2ME defines
○ A series of Java virtual machines, specifically designed for different types of devices
○ A group of libraries and APIs that can be run on the virtual machines, also known as configurations and profiles
○ Various tools for deployment and device configuration

3. J2ME ARCHITECTURE
a. Configuration
- It defines the minimum environment for Java to execute
- It defines the following:
○ The subset of the Java programming language
○ The functionality of the Java Virtual Machine
○ The core platform libraries
○ The security and networking features
- There are 2 standard configurations
○ CDC - Connected Device Configuration (high-end)
 This contains a full-featured Java virtual machine.
 Resource requirements
□ The device is powered by a 32-bit processor
□ The device has 2 MB or more of total memory available for Java. This includes both RAM and flash
memory or ROM
□ The device requires the full functionality of the Java 2 "Blue Book" virtual machine
□ The device has connectivity to some kind of network, often with a wireless, intermittent connection
and with limited (often 9600 bps or less) bandwidth
□ The device may have a user interface with some degree of sophistication, but a user interface is not
mandatory
 Resource packages
□ 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
 It includes the Generic Connection Framework
□ This provides a common foundation for connections like HTTP, Sockets and Datagram. Although not
all connection types are required to be implemented by the MIDP devices, the extensible interface
hierarchy of the Generic Connection Framework makes generalization possible.
○ CLDC - Connected Limited Device Configuration (low-end)
 Resource requirements
The device can have between 160 to 512 kilobytes of total memory available for the Java platform,

ITE 1 Page 2
Resource requirements
□ The device can have between 160 to 512 kilobytes of total memory available for the Java platform,
including both RAM and flash memory or ROM
□ The device can have limited power, such as battery-powered operation
□ The device has connectivity to some kind of network, often with a wireless, intermittent connection
and with limited (often 9600 bps or less) bandwidth
□ The device may have a user interface of some degree of sophistication, but a user interface is not
mandatory
 It defines and addresses the following areas:
□ Java language and Virtual Machine features
□ Core libraries (java.lang.*, java.util.*)
□ Input/Output (java.io.*)
□ Security
□ Networking
□ Internationalization
 Some features from J2SE removed from the CLDC
□ finalization of class instances
□ asynchronous exceptions
□ some error classes
□ user-defined class loaders
□ reflection
□ Java Native Interface (JNI)
□ thread groups and daemon threads
 It requires that all classes pass a two-phase verification process.
□ Pre-verification: done in the development machine, before installation on the device
□ Verify(runtime): done on-device during runtime and is performed by the KVM.

DISCUSSION ENDED HERE. THE FOLLOWING POINTS ARE SUMMARIES OF THE PROVIDED HAND-OUT.

b. Profiles
- This is a set of APIs that reside on top of a configuration that offers the program access to device -specific capabilities.
- These define libraries which include the user interface, networking and storage APIs. These libraries are important to
make effective applications.
- There are 5 profiles
○ The MIDP
 This is designed to be used with the CLDC configuration.
 Contains classes for user interface, persistence storage and networking
 Small applications that run under the MIDP are called MIDlets.
○ The PDA Profile
 This is based on the CLDC configuration.
 Provides user interface APIs and data storage APIs
○ The Foundation Profile
 Extends the APIs provided by the CDC, but does not provide any user APIs.
 It is meant to serve as a foundation for other profiles.
○ The Personal Profile
 Extends the Foundation Profile to provide a graphical user interface (GUI) capable of running Java web
applets.
○ The RMI Profile
 Extends the Foundation profile to provide RMI for devices
 Meant to be used with the CDC/Foundation and not the CLDC/MIDP
4. More on MIDP
- MIDP stands for Mobile Information Device Profile.
- It builds on top of the CLDC Configuration.
- Minimum requirements
○ Display
 Screen size: 96 x 54
 Display depth: 1-bit
 Pixel aspect ration: approximately 1:1
○ Input
 One or more of the following:
□ One-handed keyboard
□ Two-handed keyboard
Touch screen

ITE 1 Page 3
□ Touch screen
○ Memory
 256 kilobytes of non-validated 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.
- It defines the following:
○ the application model
○ user interface API
○ persistent storage and networking
○ gaming and media API
○ security policies
○ application deployment
○ over-the-air provisioning
5. More on MIDlet
- A MIDlet is a MIDP application.
- It is part of the javax.microedition.midlet package.
- It must extend the MIDlet class.
- It must not have a public static void main(String[]args) method.
6. MIDlet Life Cycle
- There are 3 valid states during execution of a MIDlet:
○ Active
○ Paused
○ Destroyed
- The 3 valid states necessitates implementation of the following methods:
○ startApp()
○ pauseApp()
○ destroyApp()
- The transistions between the different states are controlled by the device's AMS.
- Summary
○ AMS creates an istance of the MIDlet
 MIDlet enters the Paused state
○ AMS invokes startApp() method
 MIDlet enters the Active state
 MIDlet acquires, runs, and holds the resources it needs
○ When AMS no longer needs the MIDlet to be active
 AMS invokes the pauseApp() method
 MIDlet is stopped and enters the Paused state
 In this state, MIDlet must release any the resources it has acquired
 To re-enter the Active state, AMS must call its startApp() method
○ When AMS no longer needs the MIDlet or it wants to make room for a higher priority program in memory
 AMS calls destroyApp() method
 MIDlet enters Destroyed state
 In this state, MIDlet must release all the resources, save any persistent data and then terminate
 MIDlet can request not to be destroyed by throwing a MIDletStateChangeException
□ Request may or may not be granted by the AMS.
□ If granted, destroyApp() method will be called at a later time
○ If MIDlet wants to enter Paused state
 MIDlet performs clean-up actions
 MIDlet calls the notifyPause() method
 This notifies AMS that MIDlet has entered the Paused state
○ If MIDlet wants to enter Destroyed state
 MIDlet performs clean-up actions
 MIDlet calls the notifyDestroy() method
 This notifies AMS hat MIDlet has entered the Destroyed state
○ MIDlets can only enter the Active state from the Paused state
○ MIDlets can enter the Destroyed state from both the Paused state and Active state
○ MIDlets can enter the Paused state from the Active state or when activated initially by the AMS
7. AMS

ITE 1 Page 4
7. AMS
- AMS stands for Application Management Software.
- It is a software application that comes with the MIDP implementation that controls the installation, execution, and
removal of MIDlets.
- Sometimes referred to as the MIDlet Management Software or the Java Application Manager.
- Basic services
○ AMS provides ways for users to install and uninstall MIDlets from their wireless devices, either through a serial
cable connected to a PC, or remotely via the Internet
○ AMS provides an execution environment for a MIDlet. After a MIDlet is initialized, the AMS makes system
resources available to the MIDlet. It alo makes all classes, resource files, and application descriptor files available
to the MIDlet at runtime.
○ AMS gracefully handles all the errors that occur during the installation and execution of applications without
crashing the system.
8. MIDlet Suites
- A MIDlet suite is a set of MIDlets tat are packaged together into a single JAR file.
- MIDlets within the same suite can share the classes and resources obtained in the JAR file.
- MIDlets from different suites cannot interact directly.

B. PostDiscussionReminders
- Review for quiz on 06.23.10
- Think of possible project application using J2ME

C. SharedStuff
D. Author
|Jun Malazo, BSIT-3
| http://www.facebook.com/juro.ma
| http://www.juroma.wordpress.com
| http://www.plurk.com/juroma/invite
| http://www.scribd.com/juroma

ITE 1 Page 5

You might also like