SlideShare a Scribd company logo
A Taste of JavaME Overview to Java’s approach to wireless mobile application development from a developer’s perspective Thomas Wiradikusuma [email_address] www.wiradikusuma.com Presentation to the 19 th  Java User Group Meet Up (JaMU), March 4, 2006
Objective To introduce JavaME as a platform for developing wireless mobile applications.
Agenda Wireless mobile environment JavaME architecture JavaME versus JavaSE First MIDlet User interface and event handling Persistence Networking Game API Extensions (Messaging, Multimedia, Bluetooth, etc) Performance
World of Wireless Mobile Wireless is in the air. Wireless communication is one of the fastest growing technology. Cell phones subscribers worldwide exceeded two billions in 2005.  More depended to the Internet, people want it accessible from mobile devices.  3+G is coming to town.
Meet JavaME JavaME defined A little history Why JavaME? Dynamic delivery of content Offline access  Enhanced user experience and interactive content  Cross-platform compatibility Security  The power of a modern object-oriented programming language  Large developer community
JavaME Architecture
JavaME Architecture, cont’d Configurations: Connected Device Configuration Connected, Limited Device Configuration Profiles: Mobile Information Device Profile  PDA Profile Foundation Profile etc Optional packages Typically contains functionality independent of any particular vertical market segment or device family. The main goal is to allow the definition of APIs that can be added flexibly on top of a number of different profiles. One device can support multiple optional packages.
Miniaturized Standard Java APIs No floating-point in CLDC 1.0. No user class loading, object finalization, reflection, native methods, demon threads, thread groups, Collections API, etc. Simpler Runtime and System, java.io, date functions, exception handling, etc. TIPS:  Always refer to Javadoc. When compiling, set Language Features and Target VM to lowest Java SDK available (IDEs can help this).
Developing MIDlet Edit Source Code > Compile > Preverify > Package > Test or Deploy. Free development tools:  J2ME Wireless Toolkit  EclipseME (an Eclipse plug-in) NetBeans Mobility Pack (a NetBeans module) Obfuscation: minimizing the size of MIDlet suite JARs. Originally designed to foil attempts to reverse engineer compiled bytecode, perform any combination of the following functions: Renaming things to make them compact Removing unused things Inserting illegal or questionable data to confuse decompilers  Other useful tools:  Antenna (specialized  Ant tasks to help with MIDlet suite builds) J2ME Polish Test your application in (varying) real devices as often as possible.
First MIDlet (“Hello World”)
User Interface
Event Handling A command is something the user can invoke—you can think of it as a button. Like a button, it has a title, like “OK” or “Cancel,” and your application can respond appropriately when the user invokes the command. The premise is that you want a command to be available to the user, but you don't really care how it is shown on the screen or exactly how the user invokes it—keypad button, soft button, touch screen, whatever.
Persisting Data “ Record stores”, small database containing pieces of data called  records . Represented by instances of javax.microedition.rms.RecordStore.
Connecting to the World  All contained in the javax.microedition.io package and based around the Connection interface.  HTTP (and HTTPS in MIDP 2.0) is mandatory, others are optional.
Connecting to the World, cont’d TIPS: Use GET rather than POST.  Don't hard-code URLs. Put network access in a separate thread.  Handle exceptions gracefully.  Clean up after yourself.
Game API Simplifies writing 2D games. GameCanvas’ advantages over Canvas: Controls exactly  when  the display is updated Controls region of the screen to update Typical game loop: Graphics g = getGraphics();  while(true) {    // Check for user input.    // Update game state.    // Draw stuff using g.    flushGraphics();  }  Layer, Sprite, TiledLayer and LayerManager Special effects: flashBacklight() vibrate()
Optional Packages JSR 120: Wireless Messaging API JSR 135: Mobile Media API JSR 172: Web Services Specification JSR 177: Security and Trust Services JSR 179: Location API JSR 180: Session Initiation Protocol (SIP) JSR 184: Mobile 3D Graphics JSR 190: Event Tracking API And a whole lot more…
Performance Issues Benchmarking Runtime.freeMemory()  Runtime.totalMemory()  System.currentTimeMilis() Run multiple times and calculate the average TIPS: First make it run, the make it run right, then make it run fast Create objects efficiently, reuse objects whenever possible Use  StringBuffer for string concatenation Use arrays, not object collection Use buffered I/O Be clean Make application responsive (“perceived performance”) Use an obfuscator  Redesign / refactor Run memory profiler Manage resources efficiently Don’t be too OO :-)
Resources Websites: wireless.java.sun.com www.microjava.com www.onjava.com/onjava/wireless www.javagaming.com www.microdevnet.com Books: Knudsen, Jonathan.  Wireless Java Developing with J2ME,  Second Edition . Apress. 2003. Riggs, Roger,  et al .  Programming Wireless Devices with the  Java™ 2 Platform, Micro Edition, Second Edition .  Addison  Wesley. 2003.
Ad

More Related Content

What's hot (20)

J2ee architecture
J2ee architectureJ2ee architecture
J2ee architecture
Erencan Özkan
 
J2ee seminar
J2ee seminarJ2ee seminar
J2ee seminar
Sahil Kukreja
 
What are the popular features of java?
What are the popular features of java?What are the popular features of java?
What are the popular features of java?
kanchanmahajan23
 
Java useful in Mule
Java useful in MuleJava useful in Mule
Java useful in Mule
Shahid Shaik
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
JanmejayaPadhiary2
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
Sudhakar Sharma
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
nomykk
 
Java Technology
Java TechnologyJava Technology
Java Technology
ifnu bima
 
Spring Mvc
Spring MvcSpring Mvc
Spring Mvc
ifnu bima
 
A PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATEA PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATE
Tushar Choudhary
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Hùng Nguyễn Huy
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
NexSoftsys
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
Vikash Chandra Das
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
Patroklos Papapetrou (Pat)
 
Spring framework
Spring frameworkSpring framework
Spring framework
Sonal Poddar
 
Java spring ppt
Java spring pptJava spring ppt
Java spring ppt
natashasweety7
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
Anil Kumar
 
What are the popular features of java?
What are the popular features of java?What are the popular features of java?
What are the popular features of java?
kanchanmahajan23
 
Java useful in Mule
Java useful in MuleJava useful in Mule
Java useful in Mule
Shahid Shaik
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
Sudhakar Sharma
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
nomykk
 
Java Technology
Java TechnologyJava Technology
Java Technology
ifnu bima
 
A PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATEA PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATE
Tushar Choudhary
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Hùng Nguyễn Huy
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
NexSoftsys
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
Vikash Chandra Das
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
Anil Kumar
 

Similar to A Taste of Java ME (20)

PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
Dharani Kumar Madduri
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
Muthu Kumar
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
Ajailal Parackal
 
Mobile Java
Mobile JavaMobile Java
Mobile Java
Nikita Makarov
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
Bhavya Siddappa
 
1 introduction of android
1 introduction of android1 introduction of android
1 introduction of android
akila_mano
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21
dxsaki
 
Android presentation
Android presentationAndroid presentation
Android presentation
Imam Raza
 
J2 Me Gaming Using Netbeans
J2 Me Gaming Using NetbeansJ2 Me Gaming Using Netbeans
J2 Me Gaming Using Netbeans
strongdevil
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDP
SMIJava
 
Java-Unit-I.ppt
Java-Unit-I.pptJava-Unit-I.ppt
Java-Unit-I.ppt
RameswarGprec
 
Android Overview
Android OverviewAndroid Overview
Android Overview
Publicis Sapient Engineering
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
Predhin Sapru
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
Wambua Wambua
 
Android
AndroidAndroid
Android
aktash12
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
Vando Batista
 
Android overview
Android overviewAndroid overview
Android overview
Has Taiar
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to Titanium
Graham Weldon
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
Lars Vogel
 
Vaadin codemotion 2014
Vaadin codemotion 2014Vaadin codemotion 2014
Vaadin codemotion 2014
Manuel Carrasco Moñino
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
Muthu Kumar
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
Ajailal Parackal
 
1 introduction of android
1 introduction of android1 introduction of android
1 introduction of android
akila_mano
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21
dxsaki
 
Android presentation
Android presentationAndroid presentation
Android presentation
Imam Raza
 
J2 Me Gaming Using Netbeans
J2 Me Gaming Using NetbeansJ2 Me Gaming Using Netbeans
J2 Me Gaming Using Netbeans
strongdevil
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDP
SMIJava
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
Predhin Sapru
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
Wambua Wambua
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
Vando Batista
 
Android overview
Android overviewAndroid overview
Android overview
Has Taiar
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to Titanium
Graham Weldon
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
Lars Vogel
 
Ad

More from wiradikusuma (6)

Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
wiradikusuma
 
Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Java
wiradikusuma
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solution
wiradikusuma
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
wiradikusuma
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
wiradikusuma
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
wiradikusuma
 
Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Java
wiradikusuma
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solution
wiradikusuma
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Ad

Recently uploaded (20)

Treis & Friends One sheet - Portfolio IV
Treis & Friends One sheet - Portfolio IVTreis & Friends One sheet - Portfolio IV
Treis & Friends One sheet - Portfolio IV
aparicioregina7
 
Salesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptxSalesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptx
reinbauwens1
 
AlaskaSilver Corporate Presentation Apr 28 2025.pdf
AlaskaSilver Corporate Presentation Apr 28 2025.pdfAlaskaSilver Corporate Presentation Apr 28 2025.pdf
AlaskaSilver Corporate Presentation Apr 28 2025.pdf
Western Alaska Minerals Corp.
 
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand AwarenessAlec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler
 
Disinformation in Society Report 2025 Key Findings
Disinformation in Society Report 2025 Key FindingsDisinformation in Society Report 2025 Key Findings
Disinformation in Society Report 2025 Key Findings
MariumAbdulhussein
 
BeMetals_Presentation_May_2025 .pdf
BeMetals_Presentation_May_2025      .pdfBeMetals_Presentation_May_2025      .pdf
BeMetals_Presentation_May_2025 .pdf
DerekIwanaka2
 
NewBase 28 April 2025 Energy News issue - 1783 by Khaled Al Awadi_compressed...
NewBase 28 April 2025  Energy News issue - 1783 by Khaled Al Awadi_compressed...NewBase 28 April 2025  Energy News issue - 1783 by Khaled Al Awadi_compressed...
NewBase 28 April 2025 Energy News issue - 1783 by Khaled Al Awadi_compressed...
Khaled Al Awadi
 
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
AMITKUMARVERMA479091
 
Looking for Reliable BPO Project Providers?"
Looking for Reliable BPO Project Providers?"Looking for Reliable BPO Project Providers?"
Looking for Reliable BPO Project Providers?"
anujascentbpo
 
intra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.pptintra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.ppt
NTTDATA INTRAMART
 
Region Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdfRegion Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdf
Consultonmic
 
The Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of HatsThe Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of Hats
nimrabilal030
 
Level Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up SuccessLevel Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up Success
Best Virtual Specialist
 
Brandon Flatley - A Skilled Musician
Brandon Flatley - A Skilled MusicianBrandon Flatley - A Skilled Musician
Brandon Flatley - A Skilled Musician
Brandon Flatley
 
The Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdfThe Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdf
Richard Lucas
 
Affinity.co Lifecycle Marketing Presentation
Affinity.co Lifecycle Marketing PresentationAffinity.co Lifecycle Marketing Presentation
Affinity.co Lifecycle Marketing Presentation
omiller199514
 
TMG - Q3 2025 Earnings Call Slides - v4.pptx
TMG - Q3 2025 Earnings Call Slides - v4.pptxTMG - Q3 2025 Earnings Call Slides - v4.pptx
TMG - Q3 2025 Earnings Call Slides - v4.pptx
Marketing847413
 
EquariusAI analytics for business water risk
EquariusAI analytics for business water riskEquariusAI analytics for business water risk
EquariusAI analytics for business water risk
Peter Adriaens
 
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Lviv Startup Club
 
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdfAccounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
CA Suvidha Chaplot
 
Treis & Friends One sheet - Portfolio IV
Treis & Friends One sheet - Portfolio IVTreis & Friends One sheet - Portfolio IV
Treis & Friends One sheet - Portfolio IV
aparicioregina7
 
Salesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptxSalesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptx
reinbauwens1
 
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand AwarenessAlec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler
 
Disinformation in Society Report 2025 Key Findings
Disinformation in Society Report 2025 Key FindingsDisinformation in Society Report 2025 Key Findings
Disinformation in Society Report 2025 Key Findings
MariumAbdulhussein
 
BeMetals_Presentation_May_2025 .pdf
BeMetals_Presentation_May_2025      .pdfBeMetals_Presentation_May_2025      .pdf
BeMetals_Presentation_May_2025 .pdf
DerekIwanaka2
 
NewBase 28 April 2025 Energy News issue - 1783 by Khaled Al Awadi_compressed...
NewBase 28 April 2025  Energy News issue - 1783 by Khaled Al Awadi_compressed...NewBase 28 April 2025  Energy News issue - 1783 by Khaled Al Awadi_compressed...
NewBase 28 April 2025 Energy News issue - 1783 by Khaled Al Awadi_compressed...
Khaled Al Awadi
 
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
PREDICTION%20AND%20ANALYSIS%20OF%20ADMET%20PROPERTIES%20OF%20NEW%20MOLECULE%2...
AMITKUMARVERMA479091
 
Looking for Reliable BPO Project Providers?"
Looking for Reliable BPO Project Providers?"Looking for Reliable BPO Project Providers?"
Looking for Reliable BPO Project Providers?"
anujascentbpo
 
intra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.pptintra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.ppt
NTTDATA INTRAMART
 
Region Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdfRegion Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdf
Consultonmic
 
The Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of HatsThe Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of Hats
nimrabilal030
 
Level Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up SuccessLevel Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up Success
Best Virtual Specialist
 
Brandon Flatley - A Skilled Musician
Brandon Flatley - A Skilled MusicianBrandon Flatley - A Skilled Musician
Brandon Flatley - A Skilled Musician
Brandon Flatley
 
The Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdfThe Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdf
Richard Lucas
 
Affinity.co Lifecycle Marketing Presentation
Affinity.co Lifecycle Marketing PresentationAffinity.co Lifecycle Marketing Presentation
Affinity.co Lifecycle Marketing Presentation
omiller199514
 
TMG - Q3 2025 Earnings Call Slides - v4.pptx
TMG - Q3 2025 Earnings Call Slides - v4.pptxTMG - Q3 2025 Earnings Call Slides - v4.pptx
TMG - Q3 2025 Earnings Call Slides - v4.pptx
Marketing847413
 
EquariusAI analytics for business water risk
EquariusAI analytics for business water riskEquariusAI analytics for business water risk
EquariusAI analytics for business water risk
Peter Adriaens
 
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Yuriy Chapran: Zero Trust and Beyond: OpenVPN’s Role in Next-Gen Network Secu...
Lviv Startup Club
 
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdfAccounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
CA Suvidha Chaplot
 

A Taste of Java ME

  • 1. A Taste of JavaME Overview to Java’s approach to wireless mobile application development from a developer’s perspective Thomas Wiradikusuma [email_address] www.wiradikusuma.com Presentation to the 19 th Java User Group Meet Up (JaMU), March 4, 2006
  • 2. Objective To introduce JavaME as a platform for developing wireless mobile applications.
  • 3. Agenda Wireless mobile environment JavaME architecture JavaME versus JavaSE First MIDlet User interface and event handling Persistence Networking Game API Extensions (Messaging, Multimedia, Bluetooth, etc) Performance
  • 4. World of Wireless Mobile Wireless is in the air. Wireless communication is one of the fastest growing technology. Cell phones subscribers worldwide exceeded two billions in 2005. More depended to the Internet, people want it accessible from mobile devices. 3+G is coming to town.
  • 5. Meet JavaME JavaME defined A little history Why JavaME? Dynamic delivery of content Offline access Enhanced user experience and interactive content Cross-platform compatibility Security The power of a modern object-oriented programming language Large developer community
  • 7. JavaME Architecture, cont’d Configurations: Connected Device Configuration Connected, Limited Device Configuration Profiles: Mobile Information Device Profile PDA Profile Foundation Profile etc Optional packages Typically contains functionality independent of any particular vertical market segment or device family. The main goal is to allow the definition of APIs that can be added flexibly on top of a number of different profiles. One device can support multiple optional packages.
  • 8. Miniaturized Standard Java APIs No floating-point in CLDC 1.0. No user class loading, object finalization, reflection, native methods, demon threads, thread groups, Collections API, etc. Simpler Runtime and System, java.io, date functions, exception handling, etc. TIPS: Always refer to Javadoc. When compiling, set Language Features and Target VM to lowest Java SDK available (IDEs can help this).
  • 9. Developing MIDlet Edit Source Code > Compile > Preverify > Package > Test or Deploy. Free development tools: J2ME Wireless Toolkit EclipseME (an Eclipse plug-in) NetBeans Mobility Pack (a NetBeans module) Obfuscation: minimizing the size of MIDlet suite JARs. Originally designed to foil attempts to reverse engineer compiled bytecode, perform any combination of the following functions: Renaming things to make them compact Removing unused things Inserting illegal or questionable data to confuse decompilers Other useful tools: Antenna (specialized Ant tasks to help with MIDlet suite builds) J2ME Polish Test your application in (varying) real devices as often as possible.
  • 12. Event Handling A command is something the user can invoke—you can think of it as a button. Like a button, it has a title, like “OK” or “Cancel,” and your application can respond appropriately when the user invokes the command. The premise is that you want a command to be available to the user, but you don't really care how it is shown on the screen or exactly how the user invokes it—keypad button, soft button, touch screen, whatever.
  • 13. Persisting Data “ Record stores”, small database containing pieces of data called records . Represented by instances of javax.microedition.rms.RecordStore.
  • 14. Connecting to the World All contained in the javax.microedition.io package and based around the Connection interface. HTTP (and HTTPS in MIDP 2.0) is mandatory, others are optional.
  • 15. Connecting to the World, cont’d TIPS: Use GET rather than POST. Don't hard-code URLs. Put network access in a separate thread. Handle exceptions gracefully. Clean up after yourself.
  • 16. Game API Simplifies writing 2D games. GameCanvas’ advantages over Canvas: Controls exactly when the display is updated Controls region of the screen to update Typical game loop: Graphics g = getGraphics(); while(true) { // Check for user input. // Update game state. // Draw stuff using g. flushGraphics(); } Layer, Sprite, TiledLayer and LayerManager Special effects: flashBacklight() vibrate()
  • 17. Optional Packages JSR 120: Wireless Messaging API JSR 135: Mobile Media API JSR 172: Web Services Specification JSR 177: Security and Trust Services JSR 179: Location API JSR 180: Session Initiation Protocol (SIP) JSR 184: Mobile 3D Graphics JSR 190: Event Tracking API And a whole lot more…
  • 18. Performance Issues Benchmarking Runtime.freeMemory() Runtime.totalMemory() System.currentTimeMilis() Run multiple times and calculate the average TIPS: First make it run, the make it run right, then make it run fast Create objects efficiently, reuse objects whenever possible Use StringBuffer for string concatenation Use arrays, not object collection Use buffered I/O Be clean Make application responsive (“perceived performance”) Use an obfuscator Redesign / refactor Run memory profiler Manage resources efficiently Don’t be too OO :-)
  • 19. Resources Websites: wireless.java.sun.com www.microjava.com www.onjava.com/onjava/wireless www.javagaming.com www.microdevnet.com Books: Knudsen, Jonathan. Wireless Java Developing with J2ME, Second Edition . Apress. 2003. Riggs, Roger, et al . Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition . Addison Wesley. 2003.