SlideShare a Scribd company logo
1 of 22
Introduction to JAVA ME Mobile
    Application Development




                                              http://eglobiotraining.com/
       Prof. Erwin M. Globio, MSIT
            Resource Speaker
       http://eglobiotraining.com/



                           JAVA Mobile Apps
Mobile Devices
Mobile devices may vary in size, design and layout, but they have
some characteristics in common that are totally different from desktop
systems.




                                                                                 http://eglobiotraining.com/
              Small in size
              Mobile devices are small in size. Consumers want smaller
              devices for mobility and convenience.

              Limited memory
              Mobile devices also have small memory, both primary (RAM)
              and secondary (disk). This limitation is one of the factors that
              affects writing programs for these types of devices. With
              limited amount of memory, special considerations must be
              taken to conserve the use of this precious resource.


                                                        JAVA Mobile Apps
Continuation   (Mobile Devices)
               Limited processing power
               Mobile systems are not as powerful as their desktop
               counterparts. Size, technology and budget are some of the
               factors that affect the state of this resource. Like the disk
               storage and RAM, you can only fit so much of these resources
               in such a small package.




                                                                               http://eglobiotraining.com/
               Low power consumption
               Mobile devices consume less power than desktop machines.
               These devices must conserve the use of power because they
               run on a limited supply from batteries.

               Robust and reliable
               Because mobile devices are always carried along, they must
               be robust enough to stand the force of bumps, motion and
               occasional drops.

                                                          JAVA Mobile Apps
Continuation   (Mobile Devices)

               Limited connectivity
               Mobile devices have low bandwidth, some of them not
               connected at all. Most of them use wireless connections.




                                                                             http://eglobiotraining.com/
               Short wakeup time
               These consumer devices startup in seconds and most of them
               are always on. Take the case of mobile phones: they boot up
               within seconds and most people do not turn them off even at
               night. PDAs wakeup the second you press their power button.




                                                         JAVA Mobile Apps
Java Platform
      Java was created in 1991 by James Gosling of Sun
      Microsystems. Initially called Oak, in honor of the tree outside
      Gosling's window, its name was changed to Java because there
      was already a language called Oak.




                                                                         http://eglobiotraining.com/
      The original motivation for Java was the need for platform
      independent language that could be embedded in various
      consumer electronic products like toasters and refrigerators.
      One of the first projects developed using Java was a personal
      hand-held remote control named Star 7.

      At about the same time, the World Wide Web and the Internet
      were gaining popularity. Gosling realized that Java could be
      used for Internet programming.



                                                   JAVA Mobile Apps
Continuation   (Java Platform)
               With the release of version 1.2, the Java platform was
               classified into several editions: Now we have 1.7 version

               JAVA SE – Java 2 Platform, Standard Edition
               desktop applications




                                                                                  http://eglobiotraining.com/
               JAVA EE – Java 2 Platform, Enterprise Edition
               enterprise applications w/ focus on web              server-side
               development including servlets, JSP, EJB and XML

               JAVA ME – Java 2 Platform, Micro Edition
               mobile and handheld devices

               JavaCard
               Smart Cards


                                                             JAVA Mobile Apps
Continuation   (Java Platform)

                   Servers
                    Servers
                                  Desktop
                                  machines
                                                High-end
                    Optional                    consumer
                    Packages




                                                                                                  http://eglobiotraining.com/
                                                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)




                                                                               JAVA Mobile Apps
JAVA ME Overview
               The Java Platform, Mobile Edition (JAVA ME) is a set
      of specifications and technologies that focus on consumer
      devices. These devices have limited amount of memory, less
      processing power, small screens and low network bandwidth.

              With the proliferation of mobile consumer devices




                                                                       http://eglobiotraining.com/
      from phones, PDAs, gaming boxes to home appliances, Java
      provides a single portable environment for developing and
      running applications on these devices.

               JAVA ME programs, like all Java programs, are
      interpreted. Programs are compiled into byte codes and
      interpreted by the Java Virtual Machine (VM). JAVA ME
      provides a consistent interface with the devices. Applications
      do not have to be recompiled to be able to run on different
      machines.

                                                  JAVA Mobile Apps
CLDC
The Connected Limited Device Configuration (CLDC) defines
and addresses the following areas:
Java language and Virtual Machine (VM) features
Core libraries (java.lang.*, java.util.*)




                                                                http://eglobiotraining.com/
Input/Output (java.io.*)
Security
Networking
Internationalization




                                             JAVA Mobile Apps
MIDP
The Mobile Information Device Profile (MIDP) builds on top of the
CLDC.
The MIDP specification, much like the CLDC and other APIs, has
been defined through the Java Community Process (JCP). It
involved an expert group, from more that 50 companies,




                                                                     http://eglobiotraining.com/
composed of mobile device manufacturers, carriers and software
developers.
MIDP defines the application model, user interface API, persistent
storage and networking, gaming and media API, security policies,
application deployment and over-the-air provisioning.
                              MIDlets

                        WMA    MMAPI Optional      OEM
             MIDP 2.0
                        1.1     1.1  Packages      APIs

                         CLDC 1.0 or 1.1


                     Device Operating System


                                               JAVA Mobile Apps
MIDlet
An 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




                                                                   http://eglobiotraining.com/
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.




                                             JAVA Mobile Apps
MIDlet Life Cycle
 A MIDlet's life begins when it is instantiated by the AMS. It
 initially enters the "Paused" state after being created with the
 new command. The AMS calls the public no argument
 constructor of the MIDlet. If an exception occurs at the
 constructor, the MIDlet is put into a Destroyed state and




                                                                    http://eglobiotraining.com/
 discarded immediately.The MIDlet enters the Active state
 upon calling the startUp() method by the AMS.

 The MIDlet enters the Destroyed state when the AMS calls the
 destroyApp() method. This state is also entered when the
 notifyDestroyed() method returns succesfully to the
 application. Take note that the MIDlet enters the Destroyed
 state only once in its lifetime.




                                              JAVA Mobile Apps
MIDlet Life Cycle
                   new

                            destroyApp()




   startApp()     Paused




                                                                      http://eglobiotraining.com/
                                            Destroyed
                  Active       pauseApp()




                           destroyApp()

 To be able to create a MIDlet, we must create a subclass of the
 MIDlet class from javax.microedition.midlet package. We must
 also override or implement the methods: startApp(),
 destroyApp() and pauseApp(). These are the methods
 expected by the AMS for running and controlling our MIDlet.

                                                   JAVA Mobile Apps
Using the Sun Wireless Toolkit
We'll now use the Sun Wireless Toolkit to compile and package our MIDlet
suite (containing a single MIDlet).
Open ktoolbar (from the Wireless Toolkit distribution)

Create a new project
Project Name: HelloMidlet




                                                                               http://eglobiotraining.com/
MIDlet Class Name: HelloMidlet

On this Settings window, you can customize the a very comprehensive
selection of settings for your project. You can select what configuration to
use, what packages/APIs to include, Push Registry settings and more. For our
purposes, we will use the default project settings. Click "OK" to finish
creating the project.

Copy HelloMidlet.java into the project's "src directory: In Window, this is
under the directory: C:WTK23appsHelloMidletsrc (where C:WTK23 is
where you installed the wireless toolkit). Click "Build" and "Run":


                                                      JAVA Mobile Apps
Sample Code HelloMidlet
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloMidlet extends MIDlet implements CommandListener
{
Display display;
Command exitCommand = new Command("Exit", Command.EXIT, 1);
Alert helloAlert;




                                                                         http://eglobiotraining.com/
          public HelloMidlet(){
                   helloAlert = new Alert("Hello MIDlet", "Hello,
                                        world!",null, AlertType.INFO);
                   helloAlert.setTimeout(Alert.FOREVER);
                   helloAlert.addCommand(exitCommand);
                   helloAlert.setCommandListener(this);
          }
          public void startApp() {
                   if (display == null){
                              display = Display.getDisplay(this);
          }
          display.setCurrent(helloAlert);
}
                                                  JAVA Mobile Apps
Sample Code HelloMidlet
    public void pauseApp() { }

    public void destroyApp(boolean unconditional) { }

    public void commandAction(Command c, Displayable d){
             if (c == exitCommand){




                                                                http://eglobiotraining.com/
                       destroyApp(true);
                       notifyDestroyed(); // Exit
             }
    }
}




                                             JAVA Mobile Apps
Sample Code Explanation
Package javax.microedition.midlet
The MIDlet package defines Mobile Information Device Profile
applications and the interactions between the application and the
environment in which the application runs.

Package javax.microedition.lcdui
The UI API provides a set of features for implementation of user




                                                                       http://eglobiotraining.com/
interfaces for MIDP applications.

public interface CommandListener
This interface is used by applications which need to receive high-
level events from the implementation. An application will provide an
implementation of a CommandListener (typically by using a nested
class or an inner class) and will then provide the instance to the
addCommand method on a Displayable in order to receive high-
level events on that screen.




                                                  JAVA Mobile Apps
Sample Code Explanation
Class Summary
Alert
An alert is a screen that shows data to the user and waits for a
certain period of time before proceeding to the next Displayable.
AlertType
The AlertType provides an indication of the nature of alerts.
ChoiceGroup




                                                                     http://eglobiotraining.com/
A ChoiceGroup is a group of selectable elements intended to be
placed within a Form.
Command
The Command class is a construct that encapsulates the semantic
information of an action.
DateField
A DateField is an editable component for presenting date and time
(calendar) information that may be placed into a Form.
Display
Display represents the manager of the display and input devices of
the system.


                                                  JAVA Mobile Apps
Sample Code Explanation
Class Summary
Displayable
An object that has the capability of being placed on the display.
Implements a graphical display, such as a bar graph, of an integer
value.
List
A Screen containing list of choices.




                                                                       http://eglobiotraining.com/
StringItem
An item that can contain a string.
TextBox
The TextBox class is a Screen that allows the user to enter and edit
text.
TextField
A TextField is an editable text component that may be placed into a
Form.
Ticker
Implements a "ticker-tape", a piece of text that runs continuously
across the display.


                                                  JAVA Mobile Apps
http://eglobiotraining.com/
SAMPLE PROGRAMS
PROFESSOR’S INFORMATION




                                                                    http://eglobiotraining.com/
Prof. Erwin M. Globio, MSIT
Senior IT Lecturer of Far Eastern University
Owner and Senior Technical Trainer at http://eglobiotraining.com/
Email Address: erwin_globio@yahoo.com
Skype Id: erwinglobio
http://eglobiotraining.com/

More Related Content

What's hot

History of mobile apps
History of mobile appsHistory of mobile apps
History of mobile appsTHINK IT Training
 
Firewalls
FirewallsFirewalls
Firewallsvaishnavi
 
Seminar report of optical ethernet
Seminar report of optical ethernetSeminar report of optical ethernet
Seminar report of optical ethernetMohammad Waziruddin
 
Cisco connect montreal 2018 - Network Slicing: Horizontal Virtualization
Cisco connect montreal 2018 - Network Slicing: Horizontal VirtualizationCisco connect montreal 2018 - Network Slicing: Horizontal Virtualization
Cisco connect montreal 2018 - Network Slicing: Horizontal VirtualizationCisco Canada
 
Mobile cloud computing
Mobile cloud computingMobile cloud computing
Mobile cloud computingsnoreen
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1Senthil Kanth
 
MegaPort: Creating a Better Way for Networks and Cloud to Interconnect
MegaPort: Creating a Better Way for Networks and Cloud to InterconnectMegaPort: Creating a Better Way for Networks and Cloud to Interconnect
MegaPort: Creating a Better Way for Networks and Cloud to InterconnectDaniel Toomey
 
Seminar on mobile os
Seminar on mobile osSeminar on mobile os
Seminar on mobile osabani12
 
iParanoid: an IMSI Catcher - Stingray Intrusion Detection System
 iParanoid: an IMSI Catcher - Stingray Intrusion Detection System iParanoid: an IMSI Catcher - Stingray Intrusion Detection System
iParanoid: an IMSI Catcher - Stingray Intrusion Detection SystemLuca Bongiorni
 
Mobile jammer
Mobile jammerMobile jammer
Mobile jammerAvay Minni
 
Narrowband Internet of Things - R&S Whitepaper
Narrowband Internet of Things - R&S WhitepaperNarrowband Internet of Things - R&S Whitepaper
Narrowband Internet of Things - R&S Whitepaper3G4G
 
Mobile Computing
Mobile ComputingMobile Computing
Mobile Computinggaurav koriya
 
Voicexml
VoicexmlVoicexml
Voicexmlnavyabelli
 

What's hot (20)

Mobile computing
Mobile computingMobile computing
Mobile computing
 
History of mobile apps
History of mobile appsHistory of mobile apps
History of mobile apps
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Firewalls
FirewallsFirewalls
Firewalls
 
Seminar report of optical ethernet
Seminar report of optical ethernetSeminar report of optical ethernet
Seminar report of optical ethernet
 
5g introduction_NR
5g introduction_NR5g introduction_NR
5g introduction_NR
 
Cisco connect montreal 2018 - Network Slicing: Horizontal Virtualization
Cisco connect montreal 2018 - Network Slicing: Horizontal VirtualizationCisco connect montreal 2018 - Network Slicing: Horizontal Virtualization
Cisco connect montreal 2018 - Network Slicing: Horizontal Virtualization
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Mobile cloud computing
Mobile cloud computingMobile cloud computing
Mobile cloud computing
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1
 
MegaPort: Creating a Better Way for Networks and Cloud to Interconnect
MegaPort: Creating a Better Way for Networks and Cloud to InterconnectMegaPort: Creating a Better Way for Networks and Cloud to Interconnect
MegaPort: Creating a Better Way for Networks and Cloud to Interconnect
 
Mobile platforms
Mobile platformsMobile platforms
Mobile platforms
 
Seminar on mobile os
Seminar on mobile osSeminar on mobile os
Seminar on mobile os
 
iParanoid: an IMSI Catcher - Stingray Intrusion Detection System
 iParanoid: an IMSI Catcher - Stingray Intrusion Detection System iParanoid: an IMSI Catcher - Stingray Intrusion Detection System
iParanoid: an IMSI Catcher - Stingray Intrusion Detection System
 
Mobile jammer
Mobile jammerMobile jammer
Mobile jammer
 
LTE Core Network
LTE Core Network LTE Core Network
LTE Core Network
 
Narrowband Internet of Things - R&S Whitepaper
Narrowband Internet of Things - R&S WhitepaperNarrowband Internet of Things - R&S Whitepaper
Narrowband Internet of Things - R&S Whitepaper
 
Mobile Computing
Mobile ComputingMobile Computing
Mobile Computing
 
Voicexml
VoicexmlVoicexml
Voicexml
 

Similar to Introduction to Java ME Mobile Development

Mobile Application Development MAD J2ME
Mobile Application Development  MAD J2MEMobile Application Development  MAD J2ME
Mobile Application Development MAD J2MEPallepati Vasavi
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSSenthil Kanth
 
Mobile application development
Mobile application developmentMobile application development
Mobile application developmentGovardhan Gottigalla
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Wambua Wambua
 
Mobile computing devices
Mobile computing devicesMobile computing devices
Mobile computing devicesPrashant Laxman
 
01 java 2 micro edition
01 java 2 micro edition01 java 2 micro edition
01 java 2 micro editioncorneliuskoo
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDPSMIJava
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app developmentMuthu Kumar
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Wambua Wambua
 
Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Marlon Luz
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development EnvironmentPredhin Sapru
 
Mobile Bootcamp Presentation: Mobile Application Development Platforms
Mobile Bootcamp Presentation: Mobile Application Development PlatformsMobile Bootcamp Presentation: Mobile Application Development Platforms
Mobile Bootcamp Presentation: Mobile Application Development PlatformsWilfred Mutua Mworia
 
What is Java | Learn Java | Types of Java
What is Java | Learn Java | Types of JavaWhat is Java | Learn Java | Types of Java
What is Java | Learn Java | Types of Javadevbhargav1
 

Similar to Introduction to Java ME Mobile Development (20)

Mobile Application Development MAD J2ME
Mobile Application Development  MAD J2MEMobile Application Development  MAD J2ME
Mobile Application Development MAD J2ME
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
J2 Me
J2 MeJ2 Me
J2 Me
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
 
Mobile computing devices
Mobile computing devicesMobile computing devices
Mobile computing devices
 
01 java 2 micro edition
01 java 2 micro edition01 java 2 micro edition
01 java 2 micro edition
 
JAVA CORE
JAVA COREJAVA CORE
JAVA CORE
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDP
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
 
J2ME
J2MEJ2ME
J2ME
 
Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1
 
Java me introduction
Java me   introductionJava me   introduction
Java me introduction
 
Java me introduction
Java me   introductionJava me   introduction
Java me introduction
 
Java me introduction
Java me   introductionJava me   introduction
Java me introduction
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
 
Mobile Bootcamp Presentation: Mobile Application Development Platforms
Mobile Bootcamp Presentation: Mobile Application Development PlatformsMobile Bootcamp Presentation: Mobile Application Development Platforms
Mobile Bootcamp Presentation: Mobile Application Development Platforms
 
J2me
J2meJ2me
J2me
 
What is Java | Learn Java | Types of Java
What is Java | Learn Java | Types of JavaWhat is Java | Learn Java | Types of Java
What is Java | Learn Java | Types of Java
 

More from Prof. Erwin Globio

Embedded System Presentation
Embedded System PresentationEmbedded System Presentation
Embedded System PresentationProf. Erwin Globio
 
BSCS | BSIT Thesis Guidelines
BSCS | BSIT Thesis GuidelinesBSCS | BSIT Thesis Guidelines
BSCS | BSIT Thesis GuidelinesProf. Erwin Globio
 
Ethics for IT Professionals
Ethics for IT ProfessionalsEthics for IT Professionals
Ethics for IT ProfessionalsProf. Erwin Globio
 
Cisco Router Basic Configuration
Cisco Router Basic ConfigurationCisco Router Basic Configuration
Cisco Router Basic ConfigurationProf. Erwin Globio
 
Introduction to iOS Apps Development
Introduction to iOS Apps DevelopmentIntroduction to iOS Apps Development
Introduction to iOS Apps DevelopmentProf. Erwin Globio
 
Introduction to Android Development Latest
Introduction to Android Development LatestIntroduction to Android Development Latest
Introduction to Android Development LatestProf. Erwin Globio
 
iOS Apps Development (SQLite Tutorial Part 2)
iOS Apps Development (SQLite Tutorial Part 2)iOS Apps Development (SQLite Tutorial Part 2)
iOS Apps Development (SQLite Tutorial Part 2)Prof. Erwin Globio
 
iOS Apps Development (SQLite Tutorial Part 1)
iOS Apps Development (SQLite Tutorial Part 1)iOS Apps Development (SQLite Tutorial Part 1)
iOS Apps Development (SQLite Tutorial Part 1)Prof. Erwin Globio
 
A tutorial on C++ Programming
A tutorial on C++ ProgrammingA tutorial on C++ Programming
A tutorial on C++ ProgrammingProf. Erwin Globio
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
Solutions to Common Android Problems
Solutions to Common Android ProblemsSolutions to Common Android Problems
Solutions to Common Android ProblemsProf. Erwin Globio
 
Android Development Tools and Installation
Android Development Tools and InstallationAndroid Development Tools and Installation
Android Development Tools and InstallationProf. Erwin Globio
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections TutorialsProf. Erwin Globio
 

More from Prof. Erwin Globio (20)

Embedded System Presentation
Embedded System PresentationEmbedded System Presentation
Embedded System Presentation
 
BSCS | BSIT Thesis Guidelines
BSCS | BSIT Thesis GuidelinesBSCS | BSIT Thesis Guidelines
BSCS | BSIT Thesis Guidelines
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 
Networking Trends
Networking TrendsNetworking Trends
Networking Trends
 
Sq lite presentation
Sq lite presentationSq lite presentation
Sq lite presentation
 
Ethics for IT Professionals
Ethics for IT ProfessionalsEthics for IT Professionals
Ethics for IT Professionals
 
Cisco Router Basic Configuration
Cisco Router Basic ConfigurationCisco Router Basic Configuration
Cisco Router Basic Configuration
 
Introduction to iOS Apps Development
Introduction to iOS Apps DevelopmentIntroduction to iOS Apps Development
Introduction to iOS Apps Development
 
Cloud Computing Latest
Cloud Computing LatestCloud Computing Latest
Cloud Computing Latest
 
Introduction to Android Development Latest
Introduction to Android Development LatestIntroduction to Android Development Latest
Introduction to Android Development Latest
 
iOS Apps Development (SQLite Tutorial Part 2)
iOS Apps Development (SQLite Tutorial Part 2)iOS Apps Development (SQLite Tutorial Part 2)
iOS Apps Development (SQLite Tutorial Part 2)
 
iOS Apps Development (SQLite Tutorial Part 1)
iOS Apps Development (SQLite Tutorial Part 1)iOS Apps Development (SQLite Tutorial Part 1)
iOS Apps Development (SQLite Tutorial Part 1)
 
A tutorial on C++ Programming
A tutorial on C++ ProgrammingA tutorial on C++ Programming
A tutorial on C++ Programming
 
Overview of C Language
Overview of C LanguageOverview of C Language
Overview of C Language
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Android Fragments
Android FragmentsAndroid Fragments
Android Fragments
 
Solutions to Common Android Problems
Solutions to Common Android ProblemsSolutions to Common Android Problems
Solutions to Common Android Problems
 
Android Development Tools and Installation
Android Development Tools and InstallationAndroid Development Tools and Installation
Android Development Tools and Installation
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
 

Recently uploaded

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Dr. Mazin Mohamed alkathiri
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Introduction to Java ME Mobile Development

  • 1. Introduction to JAVA ME Mobile Application Development http://eglobiotraining.com/ Prof. Erwin M. Globio, MSIT Resource Speaker http://eglobiotraining.com/ JAVA Mobile Apps
  • 2. Mobile Devices Mobile devices may vary in size, design and layout, but they have some characteristics in common that are totally different from desktop systems. http://eglobiotraining.com/ Small in size Mobile devices are small in size. Consumers want smaller devices for mobility and convenience. Limited memory Mobile devices also have small memory, both primary (RAM) and secondary (disk). This limitation is one of the factors that affects writing programs for these types of devices. With limited amount of memory, special considerations must be taken to conserve the use of this precious resource. JAVA Mobile Apps
  • 3. Continuation (Mobile Devices) Limited processing power Mobile systems are not as powerful as their desktop counterparts. Size, technology and budget are some of the factors that affect the state of this resource. Like the disk storage and RAM, you can only fit so much of these resources in such a small package. http://eglobiotraining.com/ Low power consumption Mobile devices consume less power than desktop machines. These devices must conserve the use of power because they run on a limited supply from batteries. Robust and reliable Because mobile devices are always carried along, they must be robust enough to stand the force of bumps, motion and occasional drops. JAVA Mobile Apps
  • 4. Continuation (Mobile Devices) Limited connectivity Mobile devices have low bandwidth, some of them not connected at all. Most of them use wireless connections. http://eglobiotraining.com/ Short wakeup time These consumer devices startup in seconds and most of them are always on. Take the case of mobile phones: they boot up within seconds and most people do not turn them off even at night. PDAs wakeup the second you press their power button. JAVA Mobile Apps
  • 5. Java Platform Java was created in 1991 by James Gosling of Sun Microsystems. Initially called Oak, in honor of the tree outside Gosling's window, its name was changed to Java because there was already a language called Oak. http://eglobiotraining.com/ The original motivation for Java was the need for platform independent language that could be embedded in various consumer electronic products like toasters and refrigerators. One of the first projects developed using Java was a personal hand-held remote control named Star 7. At about the same time, the World Wide Web and the Internet were gaining popularity. Gosling realized that Java could be used for Internet programming. JAVA Mobile Apps
  • 6. Continuation (Java Platform) With the release of version 1.2, the Java platform was classified into several editions: Now we have 1.7 version JAVA SE – Java 2 Platform, Standard Edition desktop applications http://eglobiotraining.com/ JAVA EE – Java 2 Platform, Enterprise Edition enterprise applications w/ focus on web server-side development including servlets, JSP, EJB and XML JAVA ME – Java 2 Platform, Micro Edition mobile and handheld devices JavaCard Smart Cards JAVA Mobile Apps
  • 7. Continuation (Java Platform) Servers Servers Desktop machines High-end Optional consumer Packages http://eglobiotraining.com/ 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) JAVA Mobile Apps
  • 8. JAVA ME Overview The Java Platform, Mobile Edition (JAVA ME) is a set of specifications and technologies that focus on consumer devices. These devices have limited amount of memory, less processing power, small screens and low network bandwidth. With the proliferation of mobile consumer devices http://eglobiotraining.com/ from phones, PDAs, gaming boxes to home appliances, Java provides a single portable environment for developing and running applications on these devices. JAVA ME programs, like all Java programs, are interpreted. Programs are compiled into byte codes and interpreted by the Java Virtual Machine (VM). JAVA ME provides a consistent interface with the devices. Applications do not have to be recompiled to be able to run on different machines. JAVA Mobile Apps
  • 9. CLDC The Connected Limited Device Configuration (CLDC) defines and addresses the following areas: Java language and Virtual Machine (VM) features Core libraries (java.lang.*, java.util.*) http://eglobiotraining.com/ Input/Output (java.io.*) Security Networking Internationalization JAVA Mobile Apps
  • 10. MIDP The Mobile Information Device Profile (MIDP) builds on top of the CLDC. The MIDP specification, much like the CLDC and other APIs, has been defined through the Java Community Process (JCP). It involved an expert group, from more that 50 companies, http://eglobiotraining.com/ composed of mobile device manufacturers, carriers and software developers. MIDP defines the application model, user interface API, persistent storage and networking, gaming and media API, security policies, application deployment and over-the-air provisioning. MIDlets WMA MMAPI Optional OEM MIDP 2.0 1.1 1.1 Packages APIs CLDC 1.0 or 1.1 Device Operating System JAVA Mobile Apps
  • 11. MIDlet An 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 http://eglobiotraining.com/ 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. JAVA Mobile Apps
  • 12. MIDlet Life Cycle A MIDlet's life begins when it is instantiated by the AMS. It initially enters the "Paused" state after being created with the new command. The AMS calls the public no argument constructor of the MIDlet. If an exception occurs at the constructor, the MIDlet is put into a Destroyed state and http://eglobiotraining.com/ discarded immediately.The MIDlet enters the Active state upon calling the startUp() method by the AMS. The MIDlet enters the Destroyed state when the AMS calls the destroyApp() method. This state is also entered when the notifyDestroyed() method returns succesfully to the application. Take note that the MIDlet enters the Destroyed state only once in its lifetime. JAVA Mobile Apps
  • 13. MIDlet Life Cycle new destroyApp() startApp() Paused http://eglobiotraining.com/ Destroyed Active pauseApp() destroyApp() To be able to create a MIDlet, we must create a subclass of the MIDlet class from javax.microedition.midlet package. We must also override or implement the methods: startApp(), destroyApp() and pauseApp(). These are the methods expected by the AMS for running and controlling our MIDlet. JAVA Mobile Apps
  • 14. Using the Sun Wireless Toolkit We'll now use the Sun Wireless Toolkit to compile and package our MIDlet suite (containing a single MIDlet). Open ktoolbar (from the Wireless Toolkit distribution) Create a new project Project Name: HelloMidlet http://eglobiotraining.com/ MIDlet Class Name: HelloMidlet On this Settings window, you can customize the a very comprehensive selection of settings for your project. You can select what configuration to use, what packages/APIs to include, Push Registry settings and more. For our purposes, we will use the default project settings. Click "OK" to finish creating the project. Copy HelloMidlet.java into the project's "src directory: In Window, this is under the directory: C:WTK23appsHelloMidletsrc (where C:WTK23 is where you installed the wireless toolkit). Click "Build" and "Run": JAVA Mobile Apps
  • 15. Sample Code HelloMidlet import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMidlet extends MIDlet implements CommandListener { Display display; Command exitCommand = new Command("Exit", Command.EXIT, 1); Alert helloAlert; http://eglobiotraining.com/ public HelloMidlet(){ helloAlert = new Alert("Hello MIDlet", "Hello, world!",null, AlertType.INFO); helloAlert.setTimeout(Alert.FOREVER); helloAlert.addCommand(exitCommand); helloAlert.setCommandListener(this); } public void startApp() { if (display == null){ display = Display.getDisplay(this); } display.setCurrent(helloAlert); } JAVA Mobile Apps
  • 16. Sample Code HelloMidlet public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d){ if (c == exitCommand){ http://eglobiotraining.com/ destroyApp(true); notifyDestroyed(); // Exit } } } JAVA Mobile Apps
  • 17. Sample Code Explanation Package javax.microedition.midlet The MIDlet package defines Mobile Information Device Profile applications and the interactions between the application and the environment in which the application runs. Package javax.microedition.lcdui The UI API provides a set of features for implementation of user http://eglobiotraining.com/ interfaces for MIDP applications. public interface CommandListener This interface is used by applications which need to receive high- level events from the implementation. An application will provide an implementation of a CommandListener (typically by using a nested class or an inner class) and will then provide the instance to the addCommand method on a Displayable in order to receive high- level events on that screen. JAVA Mobile Apps
  • 18. Sample Code Explanation Class Summary Alert An alert is a screen that shows data to the user and waits for a certain period of time before proceeding to the next Displayable. AlertType The AlertType provides an indication of the nature of alerts. ChoiceGroup http://eglobiotraining.com/ A ChoiceGroup is a group of selectable elements intended to be placed within a Form. Command The Command class is a construct that encapsulates the semantic information of an action. DateField A DateField is an editable component for presenting date and time (calendar) information that may be placed into a Form. Display Display represents the manager of the display and input devices of the system. JAVA Mobile Apps
  • 19. Sample Code Explanation Class Summary Displayable An object that has the capability of being placed on the display. Implements a graphical display, such as a bar graph, of an integer value. List A Screen containing list of choices. http://eglobiotraining.com/ StringItem An item that can contain a string. TextBox The TextBox class is a Screen that allows the user to enter and edit text. TextField A TextField is an editable text component that may be placed into a Form. Ticker Implements a "ticker-tape", a piece of text that runs continuously across the display. JAVA Mobile Apps
  • 21. PROFESSOR’S INFORMATION http://eglobiotraining.com/ Prof. Erwin M. Globio, MSIT Senior IT Lecturer of Far Eastern University Owner and Senior Technical Trainer at http://eglobiotraining.com/ Email Address: erwin_globio@yahoo.com Skype Id: erwinglobio