SlideShare uma empresa Scribd logo
1 de 10
Programming Language for Mobile Phone
applications
Introduction to J2ME
J2ME:Programming mobile applications
J2ME architecture consists of layers located above the native
operating system, collectively referred to as the Connected
Limited Device Configuration (CLDC).
The CLDC, which is installed on top of the operating
system, forms the run-time environment for small
computing devices.
J2ME architecture
The J2ME architecture comprises three software layers .
The first layer is the configuration layer that includes the Java
Virtual Machine (JVM), which directly interacts with the native
operating system. The configuration layer also handles
interactions between the profile and the JVM.
The second layer is the profile layer, which consists of the
minimum set of application programming interfaces (APIs) for
the small computing device.
The third layer is the Mobile Information Device Profile
(MIDP).The MIDP layer contains Java APIs for user network
connections, persistence storage, and the user interface. It also
has access to CLDC libraries and MIDP libraries.
MIDlet
 A MIDlet is a J2ME application designed to operate on an MIDP small
computing device.
 A MIDlet is defined with at least a single class that is derived from the javax
.microedition.midlet.MIDlet abstract class.
 Developers commonly bundle related MIDlets into a MIDlet suite,
which is contained within the same package and implemented simultaneously on
a small computing device.
 All MIDlets within a MIDlet suite are considered a group and must be
installed and uninstalled as a group .
 Members of a MIDlet suite share resources of the host environment and
share the same instances of Java classes and run within the same JVM.
 This means if three MIDlets from the same MIDlet suite run the same
class, only one instance of the class is created at a time in the Java Virtual
Machine.
 A key benefit of the relationship among MIDlet suite members is that they
share the same data, including data in persistent storage such as user preferences.
A MIDlet suite is installed, executed, and removed by the
application manager running on the device.
The manufacturer of the small computing device provides the
application manager.
Once a MIDlet suite is installed, each member of the MIDlet
suite is given access to classes of the JVM and CLDC by the
application manager.
Likewise, a MIDlet can access classes defined in the MIDP to
interact with the user interface, network, and persistent storage.
The application manager also makes the Java archive (JAR)
file and the Java application descriptor (JAD) file
available to members of the MIDlet suite.
MIDlet Programming
A MIDlet is a class that extends the MIDlet class and is the
interface between application statements and the run-time
environment, which is controlled by the application
manager.
A MIDlet class must contain three abstract methods that are
called by the application manager to manage the life cycle of
the MIDlet.
These abstract methods are
startApp(),
pauseApp(), and
destroyApp()
The startApp() method is called by the application manager
when the MIDlet is started and contains statements that are
executed each time the application begins execution.
The pauseApp() method is called before the application
manager temporarily stops the MIDlet.
The application manager restarts the MIDlet by recalling the
startApp() method.
The destroyApp() method is called prior to the termination
of the MIDlet by the application manager.
public class BasicMIDletShell extends MIDlet
{
public void startApp()
{
}
public void pauseApp()
{
}
public void destroyApp( boolean unconditional)
{
}
}
 The destroyApp() method has a boolean parameter that is set to true if the
termination of the MIDlet is unconditional, and false if the MIDlet can throw a
MIDletStateChangeException telling the application manager that the
MIDlet does not want to be destroyed just yet.
Event Handling
 AMIDlet is an event-based application. All routines executed in
the MIDlet are invoked in response to an event reported to the
MIDlet by the application manager.
The initial event that occurs is when the MIDlet is started and the
application manager invokes the startApp() method.
A Command object is used to present a user with a selection of
options to choose from when a screen is displayed. Each screen
must have a CommandListener.
The application manager calls methods of a MIDlet. A
CommandListener monitors user events with a screen and causes
the appropriate code to execute based on the current event.
User Interfaces
 A Form is the most commonly invoked user interface element found in a MIDlet and is used
to contain other user interface elements.
 Text is placed on a form as a stringItem, a List, a ChoiceGroup, and a Ticker.
 A StringItem contains text that appears on a form that cannot be changed by the user.  
 The TextBox class and TextField class differ in that the TextBox class is derived
from the Screen class, while the TextField class is derived from the Item class. This
means that an instance of the Form class cannot contain an instance of the TextBox class,
while an instance of a TextField class must be contained within an instance of the Form
class.
  An instance of the TextBox class is created by passing four parameters to the TextBox
class constructor.
 The first parameter is the title of the text box.
 The second parameter is text used to populate the instance.
 The third parameter is the maximum number of characters that can be entered into the instance. Keep
in mind that this parameter is a request and may not be fulfilled by the device. The device determines
the maximum number of characters for an instance of the TextBox class.
 The last parameter is the constraint used to limit the types of characters that can be placed within the
instance. The TextBox class has the same methods as found in the TextField class.

Mais conteúdo relacionado

Mais procurados

J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
Prashanth Shivakumar
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
Wambua Wambua
 
01 Symbianosbasics Introducao
01 Symbianosbasics Introducao01 Symbianosbasics Introducao
01 Symbianosbasics Introducao
Tiago Romão
 

Mais procurados (20)

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)
 
J2me
J2meJ2me
J2me
 
J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
 
Presenting Cloud Computing
Presenting Cloud ComputingPresenting Cloud Computing
Presenting Cloud Computing
 
Java2 MicroEdition-J2ME
Java2 MicroEdition-J2MEJava2 MicroEdition-J2ME
Java2 MicroEdition-J2ME
 
J2ME
J2MEJ2ME
J2ME
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8
 
A dynamic application using jboss
A dynamic application using jbossA dynamic application using jboss
A dynamic application using jboss
 
Introduction to java micro edition
Introduction to java micro editionIntroduction to java micro edition
Introduction to java micro edition
 
Chapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side TechnologiesChapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side Technologies
 
01 Symbianosbasics Introducao
01 Symbianosbasics Introducao01 Symbianosbasics Introducao
01 Symbianosbasics Introducao
 
A Project Report on Insurance System with Tracking Manager
 A Project Report on Insurance System with Tracking Manager  A Project Report on Insurance System with Tracking Manager
A Project Report on Insurance System with Tracking Manager
 
Mobile Operating System
Mobile Operating SystemMobile Operating System
Mobile Operating System
 

Semelhante a Introduction to j2me

Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity Framework
Akhil Mittal
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
AbdullahMunir32
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFramework
Akhil Mittal
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
Prof Ansari
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
backdoor
 

Semelhante a Introduction to j2me (20)

Scmad Chapter03
Scmad Chapter03Scmad Chapter03
Scmad Chapter03
 
Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity Framework
 
Interface Programming Android
Interface Programming AndroidInterface Programming Android
Interface Programming Android
 
Lecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsLecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile Apps
 
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
 
Session 3 J2ME Mobile Information Device Profile(MIDP) API
Session 3 J2ME Mobile Information Device Profile(MIDP)  APISession 3 J2ME Mobile Information Device Profile(MIDP)  API
Session 3 J2ME Mobile Information Device Profile(MIDP) API
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
 
Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFramework
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES
OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTESOBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES
OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES
 
"MIDP 3.0 Master Class"
"MIDP 3.0 Master Class""MIDP 3.0 Master Class"
"MIDP 3.0 Master Class"
 
Model viewviewmodel2
Model viewviewmodel2Model viewviewmodel2
Model viewviewmodel2
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
 
College information management system.doc
College information management system.docCollege information management system.doc
College information management system.doc
 
Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in Magento
 

Último

MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 

Último (20)

MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 

Introduction to j2me

  • 1. Programming Language for Mobile Phone applications Introduction to J2ME
  • 2. J2ME:Programming mobile applications J2ME architecture consists of layers located above the native operating system, collectively referred to as the Connected Limited Device Configuration (CLDC). The CLDC, which is installed on top of the operating system, forms the run-time environment for small computing devices.
  • 3. J2ME architecture The J2ME architecture comprises three software layers . The first layer is the configuration layer that includes the Java Virtual Machine (JVM), which directly interacts with the native operating system. The configuration layer also handles interactions between the profile and the JVM. The second layer is the profile layer, which consists of the minimum set of application programming interfaces (APIs) for the small computing device. The third layer is the Mobile Information Device Profile (MIDP).The MIDP layer contains Java APIs for user network connections, persistence storage, and the user interface. It also has access to CLDC libraries and MIDP libraries.
  • 4. MIDlet  A MIDlet is a J2ME application designed to operate on an MIDP small computing device.  A MIDlet is defined with at least a single class that is derived from the javax .microedition.midlet.MIDlet abstract class.  Developers commonly bundle related MIDlets into a MIDlet suite, which is contained within the same package and implemented simultaneously on a small computing device.  All MIDlets within a MIDlet suite are considered a group and must be installed and uninstalled as a group .  Members of a MIDlet suite share resources of the host environment and share the same instances of Java classes and run within the same JVM.  This means if three MIDlets from the same MIDlet suite run the same class, only one instance of the class is created at a time in the Java Virtual Machine.  A key benefit of the relationship among MIDlet suite members is that they share the same data, including data in persistent storage such as user preferences.
  • 5. A MIDlet suite is installed, executed, and removed by the application manager running on the device. The manufacturer of the small computing device provides the application manager. Once a MIDlet suite is installed, each member of the MIDlet suite is given access to classes of the JVM and CLDC by the application manager. Likewise, a MIDlet can access classes defined in the MIDP to interact with the user interface, network, and persistent storage. The application manager also makes the Java archive (JAR) file and the Java application descriptor (JAD) file available to members of the MIDlet suite.
  • 6. MIDlet Programming A MIDlet is a class that extends the MIDlet class and is the interface between application statements and the run-time environment, which is controlled by the application manager. A MIDlet class must contain three abstract methods that are called by the application manager to manage the life cycle of the MIDlet. These abstract methods are startApp(), pauseApp(), and destroyApp()
  • 7. The startApp() method is called by the application manager when the MIDlet is started and contains statements that are executed each time the application begins execution. The pauseApp() method is called before the application manager temporarily stops the MIDlet. The application manager restarts the MIDlet by recalling the startApp() method. The destroyApp() method is called prior to the termination of the MIDlet by the application manager.
  • 8. public class BasicMIDletShell extends MIDlet { public void startApp() { } public void pauseApp() { } public void destroyApp( boolean unconditional) { } }  The destroyApp() method has a boolean parameter that is set to true if the termination of the MIDlet is unconditional, and false if the MIDlet can throw a MIDletStateChangeException telling the application manager that the MIDlet does not want to be destroyed just yet.
  • 9. Event Handling  AMIDlet is an event-based application. All routines executed in the MIDlet are invoked in response to an event reported to the MIDlet by the application manager. The initial event that occurs is when the MIDlet is started and the application manager invokes the startApp() method. A Command object is used to present a user with a selection of options to choose from when a screen is displayed. Each screen must have a CommandListener. The application manager calls methods of a MIDlet. A CommandListener monitors user events with a screen and causes the appropriate code to execute based on the current event.
  • 10. User Interfaces  A Form is the most commonly invoked user interface element found in a MIDlet and is used to contain other user interface elements.  Text is placed on a form as a stringItem, a List, a ChoiceGroup, and a Ticker.  A StringItem contains text that appears on a form that cannot be changed by the user.    The TextBox class and TextField class differ in that the TextBox class is derived from the Screen class, while the TextField class is derived from the Item class. This means that an instance of the Form class cannot contain an instance of the TextBox class, while an instance of a TextField class must be contained within an instance of the Form class.   An instance of the TextBox class is created by passing four parameters to the TextBox class constructor.  The first parameter is the title of the text box.  The second parameter is text used to populate the instance.  The third parameter is the maximum number of characters that can be entered into the instance. Keep in mind that this parameter is a request and may not be fulfilled by the device. The device determines the maximum number of characters for an instance of the TextBox class.  The last parameter is the constraint used to limit the types of characters that can be placed within the instance. The TextBox class has the same methods as found in the TextField class.