01 Introduction to Mobile
 Application Development



       Mobile Application Development   1
Objectives
At the end of the lesson, the student should be able to:


●
    Identify the characteristics of mobile devices
●
    Describe the J2ME architecture
●
    Know the role of configurations and profiles
●
    Identify the APIs provided by MIDP
●
    Describe the MIDlet life cycle


                     Mobile Application Development        2
Mobile Application Devt
●
    Mobile Devices
●
    Java 2 Micro Edition

●
    CLDC

●
    CDC

●
    MIDP

●
    MIDlets      Mobile Application Development   3
Mobile Devices
●
    Small in size

●
    Limited memory

●
    Limited processing power

●
    Low power consumption

●
    Robust and reliable

●
    Limited connectivity
                     Mobile Application Development   4
●
    Short wakeup time
Mobile Application Devt
●
    Mobile Devices

●
    Java 2 Micro Edition
●
    CLDC

●
    CDC

●
    MIDP

●
    MIDlets     Mobile Application Development   5
Java Platform
Servers
 Servers
               Desktop
               machines
                             High-end
 Optional                    consumer
 Packages
                             devices             Low-end
                                                 consumer
                Optional
                Packages                         devices

                                                            Smart
                                                            Cards
 J2EE                        Personal Profile
                J2SE
                            Foundation Profile     MIDP

                                                             Java
                                  CDC              CLDC
                                                             Card

            Java Virtual Machine                   KVM      Card VM


                           Java 2 Micro Edition (J2ME)




                Mobile Application Development                        6
J2ME Architecture

            Applications

                  Optional             OEM
Profile
                  Packages             APIs
                       Libraries
Configuration     {
                       Java Virtual Machine

    Device Operating System




      Mobile Application Development          7
Configuration


●
    the subset of the Java programming language

●
    the functionality of the Java Virtual Machine (VM)

●
    core platform libraries

●
    security and networking features

                     Mobile Application Development      8
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.



                Mobile Application Development            9
Mobile Application Devt
●
    Mobile Devices

●
    Java 2 Micro Edition

●
    CLDC
●
    CDC

●
    MIDP

●
    MIDlets      Mobile Application Development   10
CLDC
●
    Java language and Virtual Machine (VM) features

●
    Core libraries (java.lang.*, java.util.*)

●
    Input/Output (java.io.*)

●
    Security

●
    Networking

●
    Internationalization Application Development
                      Mobile                          11
Missing Features
●
    finalization of class instances

●
    asynchronous exceptions

●
    some error classes

●
    user-defined class loaders

●
    reflection

●
    Java Native Interface (JNI)

●
    thread groups and daemon threads
                     Mobile Application Development   12
CLDC Device Characteristics
●
    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

●
    low power consumption (usually battery powered)

●
    limited, intermittent network connection with limited
    bandwidth (usually wireless)



                     Mobile Application Development          13
Class Verification
      File.java
                               Install


   compile (javac)                    verify
                                    (runtime)

      File.class


      preverify                      interpret



      File.class


Development Machine                Target Device



           Mobile Application Development          14
Generic Connection Framework
                                           Connection




    Str eamConnectionNotifier                                          Dat agr amConnection




                         InputConnection                OutputConnect ion




                                     Str eam Connection




                                     Content Connect ion




                       Mobile Application Development                                         15
Mobile Application Devt
●
    Mobile Devices

●
    Java 2 Micro Edition

●
    CLDC

●
    CDC
●
    MIDP

●
    MIDlets      Mobile Application Development   16
CDC
●
    java.io                        ●
                                       java.security

●
    java.lang                      ●
                                       java.security.cert

●
    java.lang.ref                  ●
                                       java.text

●
    java.lang.math                 ●
                                       java.util

●
    java.net                       ●
                                       java.util.jar

                                   ●
                                       java.util.zip


                     Mobile Application Development         17
JWTI

                   MIDlets

           WMA       MMAPI Optional     OEM
MIDP 2.0
            1.1       1.1  Packages     APIs

             CLDC 1.0 or 1.1


       Device Operating System




       Mobile Application Development          18
Mobile Application Devt
●
    Mobile Devices

●
    Java 2 Micro Edition

●
    CLDC

●
    CDC

●
    MIDP
●
    MIDlets      Mobile Application Development   19
MID Device
●
    Display:

●
    Screen-size: 96x54

●
    Display depth: 1-bit

●
    Pixel aspect ratio: approximately 1:1

●
    Input:

●
    One or more of the following user-input mechanisms: one-
    handed keyboard, two-handed keyboard, or touch screen


                     Mobile Application Development            20
MID Device
●
    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)



                    Mobile Application Development                 21
MID Device
●
    Networking:

●
    Two-way, wireless, possibly intermittent, with limited
    bandwidth

●
    Sound:

●
    The ability to play tones, either via dedicated hardware or
    via software algorithm.




                    Mobile Application Development                22
Mobile Application Devt
●
    Mobile Devices

●
    Java 2 Micro Edition

●
    CLDC

●
    CDC

●
    MIDP

●
    MIDlets      Mobile Application Development   23
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.
                    Mobile Application Development                 24
MIDlet Life Cycle
                new

                           destroyApp()




startApp()     Paused


                                           Destroyed
               Active         pauseApp()




                         destroyApp()



               Mobile Application Development          25
Summary
●
    Mobile Devices

●
    Java 2 Micro Edition

●
    CLDC

●
    CDC

●
    MIDP

●
    MIDlets      Mobile Application Development   26

Mobile Application Development JEDI

  • 1.
    01 Introduction toMobile Application Development Mobile Application Development 1
  • 2.
    Objectives At the endof the lesson, the student should be able to: ● Identify the characteristics of mobile devices ● Describe the J2ME architecture ● Know the role of configurations and profiles ● Identify the APIs provided by MIDP ● Describe the MIDlet life cycle Mobile Application Development 2
  • 3.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 3
  • 4.
    Mobile Devices ● Small in size ● Limited memory ● Limited processing power ● Low power consumption ● Robust and reliable ● Limited connectivity Mobile Application Development 4 ● Short wakeup time
  • 5.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 5
  • 6.
    Java Platform Servers Servers Desktop machines High-end Optional consumer Packages devices Low-end consumer Optional Packages devices Smart Cards J2EE Personal Profile J2SE Foundation Profile MIDP Java CDC CLDC Card Java Virtual Machine KVM Card VM Java 2 Micro Edition (J2ME) Mobile Application Development 6
  • 7.
    J2ME Architecture Applications Optional OEM Profile Packages APIs Libraries Configuration { Java Virtual Machine Device Operating System Mobile Application Development 7
  • 8.
    Configuration ● the subset of the Java programming language ● the functionality of the Java Virtual Machine (VM) ● core platform libraries ● security and networking features Mobile Application Development 8
  • 9.
    Profiles A profile definesadditional 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. Mobile Application Development 9
  • 10.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 10
  • 11.
    CLDC ● Java language and Virtual Machine (VM) features ● Core libraries (java.lang.*, java.util.*) ● Input/Output (java.io.*) ● Security ● Networking ● Internationalization Application Development Mobile 11
  • 12.
    Missing Features ● finalization of class instances ● asynchronous exceptions ● some error classes ● user-defined class loaders ● reflection ● Java Native Interface (JNI) ● thread groups and daemon threads Mobile Application Development 12
  • 13.
    CLDC Device Characteristics ● 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 ● low power consumption (usually battery powered) ● limited, intermittent network connection with limited bandwidth (usually wireless) Mobile Application Development 13
  • 14.
    Class Verification File.java Install compile (javac) verify (runtime) File.class preverify interpret File.class Development Machine Target Device Mobile Application Development 14
  • 15.
    Generic Connection Framework Connection Str eamConnectionNotifier Dat agr amConnection InputConnection OutputConnect ion Str eam Connection Content Connect ion Mobile Application Development 15
  • 16.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 16
  • 17.
    CDC ● java.io ● java.security ● java.lang ● java.security.cert ● java.lang.ref ● java.text ● java.lang.math ● java.util ● java.net ● java.util.jar ● java.util.zip Mobile Application Development 17
  • 18.
    JWTI MIDlets WMA MMAPI Optional OEM MIDP 2.0 1.1 1.1 Packages APIs CLDC 1.0 or 1.1 Device Operating System Mobile Application Development 18
  • 19.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 19
  • 20.
    MID Device ● Display: ● Screen-size: 96x54 ● Display depth: 1-bit ● Pixel aspect ratio: approximately 1:1 ● Input: ● One or more of the following user-input mechanisms: one- handed keyboard, two-handed keyboard, or touch screen Mobile Application Development 20
  • 21.
    MID Device ● 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) Mobile Application Development 21
  • 22.
    MID Device ● Networking: ● Two-way, wireless, possibly intermittent, with limited bandwidth ● Sound: ● The ability to play tones, either via dedicated hardware or via software algorithm. Mobile Application Development 22
  • 23.
    Mobile Application Devt ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 23
  • 24.
    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. Mobile Application Development 24
  • 25.
    MIDlet Life Cycle new destroyApp() startApp() Paused Destroyed Active pauseApp() destroyApp() Mobile Application Development 25
  • 26.
    Summary ● Mobile Devices ● Java 2 Micro Edition ● CLDC ● CDC ● MIDP ● MIDlets Mobile Application Development 26