SlideShare una empresa de Scribd logo
1 de 36
J2ME

       -Kushal Modi(09BIT056)
CONTENT
   Three main Java environments
   Introduction of J2ME
   Java 2 Micro Edition
   Configurations and profiles
   Optional packages
JAVA EDITIONS
  The Java 2 Platform is split into three editions:
 Java 2 Standard Edition (J2SE) - Desktop-based
  applications
 Java 2 Enterprise Edition (J2EE) - Server-based
   applications
 Java 2 Micro Edition (J2ME) – For handheld and
  embedded devices
 Each edition provides a complete environment for
  running Java-based applications including the Java
  Virtual Machine (JVM) and runtime classes
 What separates one edition from another, then, is
  primarily the set of class libraries that each edition
  defines
 You can think of J2ME as a subset of J2SE and J2SE
  as a subset of J2EE.
INTRODUCTION
 Java Platform, Micro Edition or Java ME, is a Java
  Platform designed for Embedded System(Mobile
  Device).
 Target Devices range from industrial controls to
  mobile phones and set-top boxes.
 Java ME was designed by Sun Microsystem,
  acquired by Oracle Corporation in 2010; the
  platform replaced a similar technology,
  PersonalJava.
 Originally developed under the Java Community
  Process as JSR 68, the different flavors of Java ME
  have evolved in separate JSRs.
   Java ME devices implement a profile. The most
    common of these are the Mobile Information Device
    Profile aimed at mobile devices, such as cell phones,
    and the Personal Profile aimed at consumer products
    and embedded devices like set-top boxes and PDAs.
   Profiles are subsets of configurations, of which there are
    currently two: the Connected Limited Device
    Configuration (CLDC) and the Connected Device
    Configuration (CDC).
   There are more than 2.1 billion Java ME enabled mobile
    phones and PDAs. Although it not used on some of
    today's newest mobile platforms (e.g. iPhone, Windows
    Phone 7, BlackBerry 10, Android), it continues to be
    very popular in sub $200 devices such as Nokia's Series
    40. It is also used on new Bada operating system and
    on Symbian OS along with native software.
   As of 9th January 2012 Java ME enjoys the second
    position in mobile OS, ahead of Android as per
    netmarketshare.com
CONFIGURATION
   A configuration is a complete Java runtime
    environment:
     Java virtual machine (VM) to execute Java
     Set of core Java runtime classes
     Interface to the underlying system

 Defines a minimum platform for a horizontal
  category or grouping of devices with similar
  requirements on memory and processing power
 A J2ME application is written for a particular
  profile and a profile is based upon or extends a
  particular configuration.
CONFIGURATION
    There are 2 basic configurations:
1.    CDC (Connected Device Configuration)
2.    CLDC (Connected Limited Device Configuration)
CONNECTED DEVICE CONFIGURATION
 The Connected Device Configuration is a subset of
  Java SE, containing almost all the libraries that are
  not GUI related. It is richer than CLDC.
 CDC is used for high-end consumer devices (TV
  set-top boxes, Internet TV)
 Requirements
       512KB of read-only-memory (ROM), 256 KB of random
        access memory (RAM), minimum
       32-bit processor
       High bandwidth network connection
       Full-featured Java2 virtual machine (CVM)
       17 packages
CONNECTED LIMITED DEVICE
CONFIGURATION
   The Connected Limited Device Configuration (CLDC)
    contains a strict subset of the Java-class libraries, and is
    the minimum amount needed for a Java virtual machine
    to operate.
   A configuration provides the most basic set of libraries
    and virtual-machine features that must be present in
    each implementation of a J2ME environment. When
    coupled with one or more profiles, the Connected
    Limited Device Configuration gives developers a solid
    Java platform for creating applications for consumer and
    embedded devices. The configuration is designed for
    devices with 160KB to 512KB total memory, which has a
    minimum of 160KB of ROM and 32KB of RAM available
    for the Java platform.
CLDC (CONT…)
   CLDC (Connected Limited Device Configuration) is used for
    low-end consumer devices - cell phones, two-way pagers,
    personal digital assistants (PDAs), organizers, home appliances,
    and point of sale terminals.
   Requirements
       160 - 512 KB of total memory (160KB ROM and 32KB RAM,minimum)
       16-bit or 32-bit processor
       Low power consumption and often operating with battery power
       Connectivity with limited bandwidth
       Selected classes from:
           java.lang , java.io , java.util
       Limited VM (called KVM) without:
           Floating point types (in CLDC 1.0)
           Object finalization
           JNI (Java Native Interface) or reflection
           Thread groups or daemon threads
           User Class loaders
PROFILES
   The profile adds classes to a configuration:
      To fill in missing functionality
     To support specific uses of a device
     To address the specific demands of a vertical market
      sector, e.g., cellular telephones, washing machines,
      electronic toys
     The only one in existence is MIDP (cell phones)
SEVERAL PROFILES IN VARIOUS STAGES OF
DEVELOPMENT:

   Mobile Information Device Profile (MIDP) – CLDC
    based,used for running applications on cell phones and
    interactive pagers with small screens, wireless HTTP
    connectivity, and limited memory.
   Designed for mobile phones, the Mobile Information
    Device Profile includes a GUI, and a data storage API,
    and MIDP 2.0 includes a basic 2D gaming API.
    Applications written for this profile are called MIDlets.
    Almost all new cell phones come with a MIDP
    implementation, and it is now the de facto standard for
    downloadable cell phone games. However, many
    cellphones can run only those MIDlets that have been
    approved by the carrier, especially in North America.
 Personal Digital Assistant Profile (PDAP) –
  CLDCbased, extends MIDP with additional classes and
  features for more powerful handheld devices (uses a
  subset of Abstract Windowing Toolkit AWT)
 Foundation Profile (FP) – CDC-based, extends the
  CDC with additional J2SE classes (devices)
     The Foundation Profile is a Java ME Connected Device
      Configuration (CDC) profile. This profile is intended to be used
      by devices requiring a complete implementation of the Java
      virtual machine up to and including the entire Java Platform,
      Standard Edition API. Typical implementations will use some
      subset of that API set depending on the additional profiles
      supported.
     Personal Basis Profile (PBP) - extends the FP with
      lightweight (AWT-derived) user interface classes and a new
      application model.
 Personal Profile extends the PBP with applet support
  and heavyweight UI classes.
 Information Module Profile
     The Information Module Profile (IMP) is a profile for
      embedded, "headless" devices such as vending machines,
      industrial embedded applications, security systems, and
      similar devices with either simple or no display and with some
      limited network connectivity.
     Originally introduced by Siemens Mobile and Nokia as JSR-
      195, IMP 1.0 is a strict subset of MIDP 1.0 except that it
      doesn't include user interface APIs — in other words, it doesn't
      include support for the Java package javax.microedition.lcdui.
      JSR-228, also known as IMP-NG, is IMP's next generation
      that is based on MIDP 2.0, leveraging MIDP 2.0's new security
      and networking types and APIs, and other APIs such as
      PushRegistry and platformRequest(), but again it doesn't
      include UI APIs, nor the game.
OPTIONAL PACKAGES
 The Optional Packages are set of APIs that
  support additional and common behaviors
 Examples of optional packages:
     Bluetooth Optional Package
     JDBC Optional Package
     File connection
     Personal Information Management (PIM)
OPTIONAL PACKAGES FOR THE WIRELESS
MARKET
   JSR 120: Wireless Messaging API
    JSR 135: Mobile media API
    JSR 172: J2ME Web Services Specification (want to
    try?)
    JSR 177: Security and Trust Services Specification
    JSR 179: Location API for J2ME (many students used
    that last year)
    JSR 180: Session initiation Protocol (SIP) for J2ME
    JSR 184: Mobile 3D Graphics for J2ME
    JSR 190: Event Tracking API for J2ME – monitoring
    and tracking MIDlets
HARDWARE REQUIREMENTS: MIDP
   Memory:
      256Kb non-volatile for MIDP components (in addition to
      the requirements of CLDC),
     8Kb non-volatile for application created persistent data,
     128 Kb volatile for virtual machine run time

 Display: 96x54, depth 1-bit, pixel shape 1:1
 Input: one or two-handed keypad, touch screen

 Networking: two-way, intermittent, with limited
  bandwidth
 Sound: play tones.
SOFTWARE REQUIREMENTS: MIDP
 Minimal kernel to manage the underlying hardware
  (interrupts, exceptions, and minimal scheduling)
 Mechanism for reading and writing from
  nonvolatile memory (to support persistence API)
 Read and write access to devices' wireless
  networking (to support networking API)
 A mechanism to time-stamping the records written
  in the persistence storage
 Support to write a bit-mapped graphic display

 Mechanism to capture user input from keypad or
  touch screen.
CLDC 1.1 AND MIDP 2.0 PACKAGES
   CLDC 1.1
       java.lang
       java.lang.ref
       java.io
       java.util
       javax.microedition.io
o   MIDP 2.0
       javax.microedition.lcdui
       javax.microedition.lcdui.game
       javax.microedition.media
       javax.microedition.media.control
       javax.microedition.midlet
       javax.microedition.pki
       javax.microedition.rms
DEVICES EVOLUTION (NOKIA)                               N95 (2007)

    6600 (2003)                 N70 (2005)
M

                                                       MIDP 2.0
                                                       CLDC 1.1
                                                       Advanced Multimedia
                                                       Supplements (JSR-234)
                                                       Bluetooth API (JSR-82)
                          MIDP 2.0
                                                       FileConnection and PIM API (JSR-
                          CLDC 1.1                     75)
    MIDP 2.0             Bluetooth API (JSR-82)       JTWI (JSR-185)
    CLDC 1.0             FileConnection and PIM API   Location API (JSR-179)
                          (JSR-75)                     Mobile 3D Graphics API (JSR-
    Bluetooth API                                     184)
                          JTWI (JSR-185)
    (JSR-82 No OBEX)     Mobile 3D Graphics API       Mobile Media API (JSR-135)
                                                       Nokia UI API
    Mobile Media API     (JSR-184)
                                                       Scalable 2D Vector Graphics API
    (JSR-135)            Mobile Media API             (JSR-226)
                          (JSR-135)                    Security and Trust Services API
    Nokia UI API         Nokia UI API                 (JSR-177)
    Wireless Messaging   Web Services API             SIP API (JSR-180)
                          (JSR-172)                    Web Services API (JSR-172)
    API (JSR-120)                                     Wireless Messaging API (JSR-
                          Wireless Messaging API
                                                       205)
                          (JSR-120)
MIDLETS – THE HEART OF J2ME
   MIDP does not run in the ―regular‖ Java fashion using:
    main(), System.exit()
   Instead, we use MIDlet applications - which are subclasses
    of javax.microedition.midlet.MIDlet
   The application must extend this class to allow the
    application management software to control the MIDlet:
     control the MIDlet installation
     be able to retrieve properties from the application   descriptor
     respond to a request for state change
    MIDlets are installed moving its class files to a device
    The class files are packaged in a Java Archive (JAR), and an
    accompanying descriptor file (.jad extension) describes the
    contents of the JAR.
MIDP APPLICATION LIFECYCLE
   MIDlets move from state to state in the lifecycle –
    it is the application manager that changes its state:
           Pause
         After the constructor is called or,
         pauseApp() called by AM or,

         The midlet has called a notifyPaused()

           Active
         The AM has called startApp()
         The midlet has called resumeRequest()

       Destroyed
         The AM has called destroyApp()
         The midlet has called notifyDestroyed().
MIDLET SUITE
   One or more MIDlets are packaged together into a
    MIDlet suite, composed of:
       JAR (Java archive) file
         Contains Java classes for each MIDlet in the suite and Java
          classes that are shared between MIDlets
         Contains resource files (e.g. an image) used by the MIDlets

          and a manifest file
       JAD (Java Application Descriptor) file
           Contains a predefined set of attributes that allows the device
            application management software to identify, retrieve, and
            install the MIDlets
   Eventually the JAR / JAD files are uploaded to the
    device in order to run the application.
JAVA ME MIDP DEVELOPMENT
   Requirements
     NetBeans IDE with Java ME Version 6.9 or later
     Java Development Kit (JDK) Version 6 or 7
     The Windows distribution of NetBeans 6.7 and later comes
      bundles with the Java ME SDK 3.0.
   Creating a MIDP Application Using the Visual Mobile
    Designer
       The NetBeans IDE provides a wizard that enables you to quickly
        create a MIDP project. When creating the project, you can
        choose to develop your application in the Visual Mobile Designer
        (VMD) or in the Source Code Editor. Using the VMD gives you
        the ability to visually plan out the flow of the application and
        design the screens the application uses. The designer
        automatically creates the code for the application as changes are
        saved on the design canvas.
   Editing the Java Source Code
   Compiling and Running the Project
1) BUILD
   What happens when you press the Build button?
   The toolkit finds all the .java files in the src directory of
    your project and 1) compiles them
   Source files must be compiled in a MIDP environment
    rather than a J2SE 5.0 environment
   For instance a MIDlet that uses the java.lang.System
    class: this class has different APIs in J2SE 5.0 and
    MIDP
   When the toolkit compiles your MIDlet class it uses the
    MIDP java.lang.System, not J2SE 5.0 version of the
    class
   You could make this selection yourself (if you installed
    the MIDP reference implementation), using the
    command javac and the -bootclasspath option
   javac –bootclasspath hellomidlet.java
2) PREVERIFYING CLASS FILES
   The toolkit performs an initial verification at build
    time (preverifying)
       Certain checks are performed and the class file is
        modified in such a way that the second-step (runtime)
        can be easily handled
   The device's runtime system performs a second
    verification when it loads the classes
       If a class file has not preverified it is rejected
   You could perform the first verification yourself
    using the command line preverify tool.
3) JARING
 Finally, MIDlets are bundled into MIDlet suites for
  distribution to actual devices 3) package
 Bundling entails JARing the MIDlet suite class files
  and the resource files, and putting some extra
  information in the JAR manifest
 Finally the files are 4) deployed on the device

 The above steps are not required for running the
  application in the Wireless Toolkit
 But are required if you want to deploy the MIDlet
  suit on a mobile device
DEPLOYING MIDLETS
   MIDlets can be deployed on a phone in two ways:
     Transfer the jar and jad files to the phone from the
      computer via an external connection: serial cable,
      USB cable, IRDA, Bluetooth
     Over the Air (OTA) provisioning: download the midlet
      suite from a server
 Installation is specific to the device!
 Check the documentation of your device to see how
  to install a MIDlet suite
 More on these topics in the LABS!
MANIFEST INFORMATION
   Every JAR includes a manifest file METAINF
    MANIFEST.MF
       MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet
       MIDlet-2: HitMIDlet, , HitMIDlet
       MIDlet-Name: Hellosuite
       MIDlet-Vendor: Unknown
       MIDlet-Version: 1.0
       MicroEdition-Configuration: CLDC-1.1
       MicroEdition-Profile: MIDP-2.0
 It describes the content of the archive
 It may contain extra information that is important to
  the MIDP runtime environment (e.g. a URL to
  connect).
MIDLET SUITE DESCRIPTOR
 Before a midlet can be deployed an additional file is
  required: an application description, a .jad file
 The .jad file contains a lot of the same
  information that’s in the manifest file
 The application descriptors contains information
  that help the device and/or the user to decide
  whether or not to load a MIDlet suite
 It can be downloaded and examined before
  downloading the .jar
 Useful in OTA provisioning – the server returned
  MIME type for the .jad file must be
  text/vdn.sun.j2me.app-descriptor
HELLOSUITE.JAD
 HitMIDlet.URL: http://localhost:8080/midp/hits
 MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet

 MIDlet-2: HitMIDlet, , HitMIDlet

 MIDlet-Jar-Size: 3016

 MIDlet-Jar-URL: Hellosuite.jar

 MIDlet-Name: Hellosuite

 MIDlet-Vendor: Unknown

 MIDlet-Version: 1.0

 MicroEdition-Configuration: CLDC-1.1

 MicroEdition-Profile: MIDP-2.0
MIDLET PROPERTIES
   Attributes that have meaning in a MIDlet can be added
    to the manifest and/or the application descriptor files
   It is more convenient to add an attribute to the
    application descriptor – it may be changed without
    touching the application files
   If an attribute is listed in both files the value in the
    application descriptor will be used
   A MIDlet can retrieve the values of these attributes using
    getAppProperty()
   Example:
     HitMIDlet.URL: http://localhost:8080/midp/hits in the
      Hellosuite.jad
     String url = getAppProperty(―HitMIDlet.URL‖) // in the code
DEMO APPLICATION
REFERNCES
 Web site : en.wikipedia.com
 Book : The Complete Reference J2ME by James
  Keoge
Thank you

Más contenido relacionado

La actualidad más candente

Mobile operating system..
Mobile operating system..Mobile operating system..
Mobile operating system..
Aashish Uppal
 
New Trends in Cloud Computing
New Trends in Cloud ComputingNew Trends in Cloud Computing
New Trends in Cloud Computing
Ahmed Banafa
 

La actualidad más candente (20)

5. IO virtualization
5. IO virtualization5. IO virtualization
5. IO virtualization
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Microsoft Hyper-V
Microsoft Hyper-VMicrosoft Hyper-V
Microsoft Hyper-V
 
Presentation on iOS
Presentation on iOSPresentation on iOS
Presentation on iOS
 
Android Project Presentation
Android Project PresentationAndroid Project Presentation
Android Project Presentation
 
Mobile operating system..
Mobile operating system..Mobile operating system..
Mobile operating system..
 
cloud computing:Types of virtualization
cloud computing:Types of virtualizationcloud computing:Types of virtualization
cloud computing:Types of virtualization
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Mobile cloud Computing
Mobile cloud ComputingMobile cloud Computing
Mobile cloud Computing
 
Java presentation
Java presentationJava presentation
Java presentation
 
Common Standards in Cloud Computing
Common Standards in Cloud ComputingCommon Standards in Cloud Computing
Common Standards in Cloud Computing
 
New Trends in Cloud Computing
New Trends in Cloud ComputingNew Trends in Cloud Computing
New Trends in Cloud Computing
 
Cloud interoperability
Cloud interoperabilityCloud interoperability
Cloud interoperability
 
IBM WebSphere application server
IBM WebSphere application serverIBM WebSphere application server
IBM WebSphere application server
 
App development
App developmentApp development
App development
 
Virtualization.ppt
Virtualization.pptVirtualization.ppt
Virtualization.ppt
 
Virtualization VMWare technology
Virtualization VMWare technologyVirtualization VMWare technology
Virtualization VMWare technology
 
Platform as a Service (PaaS)
Platform as a Service (PaaS)Platform as a Service (PaaS)
Platform as a Service (PaaS)
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Scheduling in cloud
Scheduling in cloudScheduling in cloud
Scheduling in cloud
 

Destacado

Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
Wambua Wambua
 
J2me Presentacion
J2me PresentacionJ2me Presentacion
J2me Presentacion
vivian7894
 
Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security Architecture
Ramesh Nagappan
 
Java j2me pre
Java j2me preJava j2me pre
Java j2me pre
jtk1
 
Tweening and morphing
Tweening and morphingTweening and morphing
Tweening and morphing
Amit Kapoor
 
Bi and erp integration
Bi and erp integrationBi and erp integration
Bi and erp integration
Jorge Garcia
 
J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
Prashanth Shivakumar
 
sasikumarj_resume
sasikumarj_resumesasikumarj_resume
sasikumarj_resume
Sasi Kumar
 
OTT in Azerbaijan - Project Brief
OTT in Azerbaijan - Project BriefOTT in Azerbaijan - Project Brief
OTT in Azerbaijan - Project Brief
Farhad Shahrivar
 

Destacado (20)

Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
 
J2ME
J2MEJ2ME
J2ME
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
 
J2ME
J2MEJ2ME
J2ME
 
Java A Tope J2 Me (Java 2 Micro Edition)
Java A Tope  J2 Me (Java 2 Micro Edition)Java A Tope  J2 Me (Java 2 Micro Edition)
Java A Tope J2 Me (Java 2 Micro Edition)
 
J2me Presentacion
J2me PresentacionJ2me Presentacion
J2me Presentacion
 
Mobile Application Development JEDI
Mobile Application Development JEDIMobile Application Development JEDI
Mobile Application Development JEDI
 
03. cse.sylbs
03. cse.sylbs03. cse.sylbs
03. cse.sylbs
 
Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security Architecture
 
Java j2me pre
Java j2me preJava j2me pre
Java j2me pre
 
Tweening and morphing
Tweening and morphingTweening and morphing
Tweening and morphing
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
08 Midlet Basic
08 Midlet Basic08 Midlet Basic
08 Midlet Basic
 
Bi and erp integration
Bi and erp integrationBi and erp integration
Bi and erp integration
 
J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
 
sasikumarj_resume
sasikumarj_resumesasikumarj_resume
sasikumarj_resume
 
OTT in Azerbaijan - Project Brief
OTT in Azerbaijan - Project BriefOTT in Azerbaijan - Project Brief
OTT in Azerbaijan - Project Brief
 
Ensoft dvb 1
Ensoft dvb 1Ensoft dvb 1
Ensoft dvb 1
 
The move from a hardware centric design to a software centric design: GStream...
The move from a hardware centric design to a software centric design: GStream...The move from a hardware centric design to a software centric design: GStream...
The move from a hardware centric design to a software centric design: GStream...
 
How To Handle An IRD Audit - Atainz
How To Handle An IRD Audit - AtainzHow To Handle An IRD Audit - Atainz
How To Handle An IRD Audit - Atainz
 

Similar a J2ME

Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
Wambua Wambua
 

Similar a J2ME (20)

Java J2ME
Java J2MEJava J2ME
Java J2ME
 
010118565.pdf
010118565.pdf010118565.pdf
010118565.pdf
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDP
 
J2 me 1
J2 me 1J2 me 1
J2 me 1
 
J2 Me
J2 MeJ2 Me
J2 Me
 
J2me
J2meJ2me
J2me
 
J2me Platform
J2me PlatformJ2me Platform
J2me Platform
 
Introduction to java micro edition
Introduction to java micro editionIntroduction to java micro edition
Introduction to java micro edition
 
Mobile Java
Mobile JavaMobile Java
Mobile Java
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
J2me
J2meJ2me
J2me
 
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
 
Mobile Application Development MAD J2ME
Mobile Application Development  MAD J2MEMobile Application Development  MAD J2ME
Mobile Application Development MAD J2ME
 
Scmad Chapter 01
Scmad Chapter 01Scmad Chapter 01
Scmad Chapter 01
 
J2ME
J2MEJ2ME
J2ME
 
Introduction To J2ME(FT - Prasanjit Dey)
Introduction To J2ME(FT - Prasanjit Dey)Introduction To J2ME(FT - Prasanjit Dey)
Introduction To J2ME(FT - Prasanjit Dey)
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introduction
 

Último

call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
vikas rana
 

Último (15)

2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptx
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by Mindbrush
 
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 

J2ME

  • 1. J2ME -Kushal Modi(09BIT056)
  • 2. CONTENT  Three main Java environments  Introduction of J2ME  Java 2 Micro Edition  Configurations and profiles  Optional packages
  • 3. JAVA EDITIONS  The Java 2 Platform is split into three editions:  Java 2 Standard Edition (J2SE) - Desktop-based applications  Java 2 Enterprise Edition (J2EE) - Server-based applications  Java 2 Micro Edition (J2ME) – For handheld and embedded devices  Each edition provides a complete environment for running Java-based applications including the Java Virtual Machine (JVM) and runtime classes  What separates one edition from another, then, is primarily the set of class libraries that each edition defines  You can think of J2ME as a subset of J2SE and J2SE as a subset of J2EE.
  • 4.
  • 5. INTRODUCTION  Java Platform, Micro Edition or Java ME, is a Java Platform designed for Embedded System(Mobile Device).  Target Devices range from industrial controls to mobile phones and set-top boxes.  Java ME was designed by Sun Microsystem, acquired by Oracle Corporation in 2010; the platform replaced a similar technology, PersonalJava.  Originally developed under the Java Community Process as JSR 68, the different flavors of Java ME have evolved in separate JSRs.
  • 6. Java ME devices implement a profile. The most common of these are the Mobile Information Device Profile aimed at mobile devices, such as cell phones, and the Personal Profile aimed at consumer products and embedded devices like set-top boxes and PDAs.  Profiles are subsets of configurations, of which there are currently two: the Connected Limited Device Configuration (CLDC) and the Connected Device Configuration (CDC).  There are more than 2.1 billion Java ME enabled mobile phones and PDAs. Although it not used on some of today's newest mobile platforms (e.g. iPhone, Windows Phone 7, BlackBerry 10, Android), it continues to be very popular in sub $200 devices such as Nokia's Series 40. It is also used on new Bada operating system and on Symbian OS along with native software.  As of 9th January 2012 Java ME enjoys the second position in mobile OS, ahead of Android as per netmarketshare.com
  • 7. CONFIGURATION  A configuration is a complete Java runtime environment:  Java virtual machine (VM) to execute Java  Set of core Java runtime classes  Interface to the underlying system  Defines a minimum platform for a horizontal category or grouping of devices with similar requirements on memory and processing power  A J2ME application is written for a particular profile and a profile is based upon or extends a particular configuration.
  • 8. CONFIGURATION  There are 2 basic configurations: 1. CDC (Connected Device Configuration) 2. CLDC (Connected Limited Device Configuration)
  • 9. CONNECTED DEVICE CONFIGURATION  The Connected Device Configuration is a subset of Java SE, containing almost all the libraries that are not GUI related. It is richer than CLDC.  CDC is used for high-end consumer devices (TV set-top boxes, Internet TV)  Requirements  512KB of read-only-memory (ROM), 256 KB of random access memory (RAM), minimum  32-bit processor  High bandwidth network connection  Full-featured Java2 virtual machine (CVM)  17 packages
  • 10. CONNECTED LIMITED DEVICE CONFIGURATION  The Connected Limited Device Configuration (CLDC) contains a strict subset of the Java-class libraries, and is the minimum amount needed for a Java virtual machine to operate.  A configuration provides the most basic set of libraries and virtual-machine features that must be present in each implementation of a J2ME environment. When coupled with one or more profiles, the Connected Limited Device Configuration gives developers a solid Java platform for creating applications for consumer and embedded devices. The configuration is designed for devices with 160KB to 512KB total memory, which has a minimum of 160KB of ROM and 32KB of RAM available for the Java platform.
  • 11. CLDC (CONT…)  CLDC (Connected Limited Device Configuration) is used for low-end consumer devices - cell phones, two-way pagers, personal digital assistants (PDAs), organizers, home appliances, and point of sale terminals.  Requirements  160 - 512 KB of total memory (160KB ROM and 32KB RAM,minimum)  16-bit or 32-bit processor  Low power consumption and often operating with battery power  Connectivity with limited bandwidth  Selected classes from:  java.lang , java.io , java.util  Limited VM (called KVM) without:  Floating point types (in CLDC 1.0)  Object finalization  JNI (Java Native Interface) or reflection  Thread groups or daemon threads  User Class loaders
  • 12. PROFILES  The profile adds classes to a configuration:  To fill in missing functionality  To support specific uses of a device  To address the specific demands of a vertical market sector, e.g., cellular telephones, washing machines, electronic toys  The only one in existence is MIDP (cell phones)
  • 13. SEVERAL PROFILES IN VARIOUS STAGES OF DEVELOPMENT:  Mobile Information Device Profile (MIDP) – CLDC based,used for running applications on cell phones and interactive pagers with small screens, wireless HTTP connectivity, and limited memory.  Designed for mobile phones, the Mobile Information Device Profile includes a GUI, and a data storage API, and MIDP 2.0 includes a basic 2D gaming API. Applications written for this profile are called MIDlets. Almost all new cell phones come with a MIDP implementation, and it is now the de facto standard for downloadable cell phone games. However, many cellphones can run only those MIDlets that have been approved by the carrier, especially in North America.
  • 14.  Personal Digital Assistant Profile (PDAP) – CLDCbased, extends MIDP with additional classes and features for more powerful handheld devices (uses a subset of Abstract Windowing Toolkit AWT)  Foundation Profile (FP) – CDC-based, extends the CDC with additional J2SE classes (devices)  The Foundation Profile is a Java ME Connected Device Configuration (CDC) profile. This profile is intended to be used by devices requiring a complete implementation of the Java virtual machine up to and including the entire Java Platform, Standard Edition API. Typical implementations will use some subset of that API set depending on the additional profiles supported.  Personal Basis Profile (PBP) - extends the FP with lightweight (AWT-derived) user interface classes and a new application model.
  • 15.  Personal Profile extends the PBP with applet support and heavyweight UI classes.  Information Module Profile  The Information Module Profile (IMP) is a profile for embedded, "headless" devices such as vending machines, industrial embedded applications, security systems, and similar devices with either simple or no display and with some limited network connectivity.  Originally introduced by Siemens Mobile and Nokia as JSR- 195, IMP 1.0 is a strict subset of MIDP 1.0 except that it doesn't include user interface APIs — in other words, it doesn't include support for the Java package javax.microedition.lcdui. JSR-228, also known as IMP-NG, is IMP's next generation that is based on MIDP 2.0, leveraging MIDP 2.0's new security and networking types and APIs, and other APIs such as PushRegistry and platformRequest(), but again it doesn't include UI APIs, nor the game.
  • 16. OPTIONAL PACKAGES  The Optional Packages are set of APIs that support additional and common behaviors  Examples of optional packages:  Bluetooth Optional Package  JDBC Optional Package  File connection  Personal Information Management (PIM)
  • 17. OPTIONAL PACKAGES FOR THE WIRELESS MARKET  JSR 120: Wireless Messaging API  JSR 135: Mobile media API  JSR 172: J2ME Web Services Specification (want to try?)  JSR 177: Security and Trust Services Specification  JSR 179: Location API for J2ME (many students used that last year)  JSR 180: Session initiation Protocol (SIP) for J2ME  JSR 184: Mobile 3D Graphics for J2ME  JSR 190: Event Tracking API for J2ME – monitoring and tracking MIDlets
  • 18. HARDWARE REQUIREMENTS: MIDP  Memory:  256Kb non-volatile for MIDP components (in addition to the requirements of CLDC),  8Kb non-volatile for application created persistent data,  128 Kb volatile for virtual machine run time  Display: 96x54, depth 1-bit, pixel shape 1:1  Input: one or two-handed keypad, touch screen  Networking: two-way, intermittent, with limited bandwidth  Sound: play tones.
  • 19. SOFTWARE REQUIREMENTS: MIDP  Minimal kernel to manage the underlying hardware (interrupts, exceptions, and minimal scheduling)  Mechanism for reading and writing from nonvolatile memory (to support persistence API)  Read and write access to devices' wireless networking (to support networking API)  A mechanism to time-stamping the records written in the persistence storage  Support to write a bit-mapped graphic display  Mechanism to capture user input from keypad or touch screen.
  • 20. CLDC 1.1 AND MIDP 2.0 PACKAGES  CLDC 1.1  java.lang  java.lang.ref  java.io  java.util  javax.microedition.io o MIDP 2.0  javax.microedition.lcdui  javax.microedition.lcdui.game  javax.microedition.media  javax.microedition.media.control  javax.microedition.midlet  javax.microedition.pki  javax.microedition.rms
  • 21. DEVICES EVOLUTION (NOKIA) N95 (2007) 6600 (2003) N70 (2005) M MIDP 2.0 CLDC 1.1 Advanced Multimedia Supplements (JSR-234) Bluetooth API (JSR-82) MIDP 2.0 FileConnection and PIM API (JSR- CLDC 1.1 75)  MIDP 2.0 Bluetooth API (JSR-82) JTWI (JSR-185)  CLDC 1.0 FileConnection and PIM API Location API (JSR-179) (JSR-75) Mobile 3D Graphics API (JSR-  Bluetooth API 184) JTWI (JSR-185)  (JSR-82 No OBEX) Mobile 3D Graphics API Mobile Media API (JSR-135) Nokia UI API  Mobile Media API (JSR-184) Scalable 2D Vector Graphics API  (JSR-135) Mobile Media API (JSR-226) (JSR-135) Security and Trust Services API  Nokia UI API Nokia UI API (JSR-177)  Wireless Messaging Web Services API SIP API (JSR-180) (JSR-172) Web Services API (JSR-172)  API (JSR-120) Wireless Messaging API (JSR- Wireless Messaging API 205) (JSR-120)
  • 22. MIDLETS – THE HEART OF J2ME  MIDP does not run in the ―regular‖ Java fashion using: main(), System.exit()  Instead, we use MIDlet applications - which are subclasses of javax.microedition.midlet.MIDlet  The application must extend this class to allow the application management software to control the MIDlet:  control the MIDlet installation  be able to retrieve properties from the application descriptor  respond to a request for state change  MIDlets are installed moving its class files to a device  The class files are packaged in a Java Archive (JAR), and an accompanying descriptor file (.jad extension) describes the contents of the JAR.
  • 23. MIDP APPLICATION LIFECYCLE  MIDlets move from state to state in the lifecycle – it is the application manager that changes its state:  Pause  After the constructor is called or,  pauseApp() called by AM or,  The midlet has called a notifyPaused()  Active  The AM has called startApp()  The midlet has called resumeRequest()  Destroyed  The AM has called destroyApp()  The midlet has called notifyDestroyed().
  • 24. MIDLET SUITE  One or more MIDlets are packaged together into a MIDlet suite, composed of:  JAR (Java archive) file  Contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets  Contains resource files (e.g. an image) used by the MIDlets and a manifest file  JAD (Java Application Descriptor) file  Contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets  Eventually the JAR / JAD files are uploaded to the device in order to run the application.
  • 25. JAVA ME MIDP DEVELOPMENT  Requirements  NetBeans IDE with Java ME Version 6.9 or later  Java Development Kit (JDK) Version 6 or 7  The Windows distribution of NetBeans 6.7 and later comes bundles with the Java ME SDK 3.0.  Creating a MIDP Application Using the Visual Mobile Designer  The NetBeans IDE provides a wizard that enables you to quickly create a MIDP project. When creating the project, you can choose to develop your application in the Visual Mobile Designer (VMD) or in the Source Code Editor. Using the VMD gives you the ability to visually plan out the flow of the application and design the screens the application uses. The designer automatically creates the code for the application as changes are saved on the design canvas.  Editing the Java Source Code  Compiling and Running the Project
  • 26. 1) BUILD  What happens when you press the Build button?  The toolkit finds all the .java files in the src directory of your project and 1) compiles them  Source files must be compiled in a MIDP environment rather than a J2SE 5.0 environment  For instance a MIDlet that uses the java.lang.System class: this class has different APIs in J2SE 5.0 and MIDP  When the toolkit compiles your MIDlet class it uses the MIDP java.lang.System, not J2SE 5.0 version of the class  You could make this selection yourself (if you installed the MIDP reference implementation), using the command javac and the -bootclasspath option  javac –bootclasspath hellomidlet.java
  • 27. 2) PREVERIFYING CLASS FILES  The toolkit performs an initial verification at build time (preverifying)  Certain checks are performed and the class file is modified in such a way that the second-step (runtime) can be easily handled  The device's runtime system performs a second verification when it loads the classes  If a class file has not preverified it is rejected  You could perform the first verification yourself using the command line preverify tool.
  • 28. 3) JARING  Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices 3) package  Bundling entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest  Finally the files are 4) deployed on the device  The above steps are not required for running the application in the Wireless Toolkit  But are required if you want to deploy the MIDlet suit on a mobile device
  • 29. DEPLOYING MIDLETS  MIDlets can be deployed on a phone in two ways:  Transfer the jar and jad files to the phone from the computer via an external connection: serial cable, USB cable, IRDA, Bluetooth  Over the Air (OTA) provisioning: download the midlet suite from a server  Installation is specific to the device!  Check the documentation of your device to see how to install a MIDlet suite  More on these topics in the LABS!
  • 30. MANIFEST INFORMATION  Every JAR includes a manifest file METAINF MANIFEST.MF  MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet  MIDlet-2: HitMIDlet, , HitMIDlet  MIDlet-Name: Hellosuite  MIDlet-Vendor: Unknown  MIDlet-Version: 1.0  MicroEdition-Configuration: CLDC-1.1  MicroEdition-Profile: MIDP-2.0  It describes the content of the archive  It may contain extra information that is important to the MIDP runtime environment (e.g. a URL to connect).
  • 31. MIDLET SUITE DESCRIPTOR  Before a midlet can be deployed an additional file is required: an application description, a .jad file  The .jad file contains a lot of the same information that’s in the manifest file  The application descriptors contains information that help the device and/or the user to decide whether or not to load a MIDlet suite  It can be downloaded and examined before downloading the .jar  Useful in OTA provisioning – the server returned MIME type for the .jad file must be text/vdn.sun.j2me.app-descriptor
  • 32. HELLOSUITE.JAD  HitMIDlet.URL: http://localhost:8080/midp/hits  MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet  MIDlet-2: HitMIDlet, , HitMIDlet  MIDlet-Jar-Size: 3016  MIDlet-Jar-URL: Hellosuite.jar  MIDlet-Name: Hellosuite  MIDlet-Vendor: Unknown  MIDlet-Version: 1.0  MicroEdition-Configuration: CLDC-1.1  MicroEdition-Profile: MIDP-2.0
  • 33. MIDLET PROPERTIES  Attributes that have meaning in a MIDlet can be added to the manifest and/or the application descriptor files  It is more convenient to add an attribute to the application descriptor – it may be changed without touching the application files  If an attribute is listed in both files the value in the application descriptor will be used  A MIDlet can retrieve the values of these attributes using getAppProperty()  Example:  HitMIDlet.URL: http://localhost:8080/midp/hits in the Hellosuite.jad  String url = getAppProperty(―HitMIDlet.URL‖) // in the code
  • 35. REFERNCES  Web site : en.wikipedia.com  Book : The Complete Reference J2ME by James Keoge