• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Java ME Mobile Development
 

Introduction to Java ME Mobile Development

on

  • 2,965 views

Introduction to Java ME Mobile Development discussed by Prof. Erwin Globio from http://eglobiotraining.com/

Introduction to Java ME Mobile Development discussed by Prof. Erwin Globio from http://eglobiotraining.com/

Statistics

Views

Total Views
2,965
Views on SlideShare
2,959
Embed Views
6

Actions

Likes
2
Downloads
108
Comments
0

2 Embeds 6

http://brazil.dyndns-server.com 4
http://test.yes2web.nl 2

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to Java ME Mobile Development Introduction to Java ME Mobile Development Presentation Transcript

    • Introduction to JAVA ME Mobile Application Development http://eglobiotraining.com/ Prof. Erwin M. Globio, MSIT Resource Speaker http://eglobiotraining.com/ JAVA Mobile Apps
    • Mobile DevicesMobile devices may vary in size, design and layout, but they havesome characteristics in common that are totally different from desktopsystems. 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 Goslings 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
    • CLDCThe Connected Limited Device Configuration (CLDC) definesand 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
    • MIDPThe Mobile Information Device Profile (MIDP) builds on top of theCLDC.The MIDP specification, much like the CLDC and other APIs, hasbeen defined through the Java Community Process (JCP). Itinvolved an expert group, from more that 50 companies, http://eglobiotraining.com/composed of mobile device manufacturers, carriers and softwaredevelopers.MIDP defines the application model, user interface API, persistentstorage 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
    • MIDletAn MIDP application is called a MIDlet. The devices applicationmanagement software (AMS) interacts directly with the MIDletwith the MIDlets create, start, pause, and destroy methods.The MIDlet is part of the javax.microedition.midlet package. AMIDlet must extend the MIDlet class. It can request http://eglobiotraining.com/parameters from the AMS as defined in the applicationdescriptor (JAD).A MIDlet does not have (and MUST NOT have) a public staticvoid main(String[] argv) method. It will not be recognized bythe AMS as the programs starting point. JAVA Mobile Apps
    • MIDlet Life Cycle A MIDlets 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 ToolkitWell now use the Sun Wireless Toolkit to compile and package our MIDletsuite (containing a single MIDlet).Open ktoolbar (from the Wireless Toolkit distribution)Create a new projectProject Name: HelloMidlet http://eglobiotraining.com/MIDlet Class Name: HelloMidletOn this Settings window, you can customize the a very comprehensiveselection of settings for your project. You can select what configuration touse, what packages/APIs to include, Push Registry settings and more. For ourpurposes, we will use the default project settings. Click "OK" to finishcreating the project.Copy HelloMidlet.java into the projects "src directory: In Window, this isunder the directory: C:WTK23appsHelloMidletsrc (where C:WTK23 iswhere you installed the wireless toolkit). Click "Build" and "Run": JAVA Mobile Apps
    • Sample Code HelloMidletimport 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 ExplanationPackage javax.microedition.midletThe MIDlet package defines Mobile Information Device Profileapplications and the interactions between the application and theenvironment in which the application runs.Package javax.microedition.lcduiThe UI API provides a set of features for implementation of user http://eglobiotraining.com/interfaces for MIDP applications.public interface CommandListenerThis interface is used by applications which need to receive high-level events from the implementation. An application will provide animplementation of a CommandListener (typically by using a nestedclass or an inner class) and will then provide the instance to theaddCommand method on a Displayable in order to receive high-level events on that screen. JAVA Mobile Apps
    • Sample Code ExplanationClass SummaryAlertAn alert is a screen that shows data to the user and waits for acertain period of time before proceeding to the next Displayable.AlertTypeThe AlertType provides an indication of the nature of alerts.ChoiceGroup http://eglobiotraining.com/A ChoiceGroup is a group of selectable elements intended to beplaced within a Form.CommandThe Command class is a construct that encapsulates the semanticinformation of an action.DateFieldA DateField is an editable component for presenting date and time(calendar) information that may be placed into a Form.DisplayDisplay represents the manager of the display and input devices ofthe system. JAVA Mobile Apps
    • Sample Code ExplanationClass SummaryDisplayableAn object that has the capability of being placed on the display.Implements a graphical display, such as a bar graph, of an integervalue.ListA Screen containing list of choices. http://eglobiotraining.com/StringItemAn item that can contain a string.TextBoxThe TextBox class is a Screen that allows the user to enter and edittext.TextFieldA TextField is an editable text component that may be placed into aForm.TickerImplements a "ticker-tape", a piece of text that runs continuouslyacross the display. JAVA Mobile Apps
    • http://eglobiotraining.com/SAMPLE PROGRAMS
    • PROFESSOR’S INFORMATION http://eglobiotraining.com/Prof. Erwin M. Globio, MSITSenior IT Lecturer of Far Eastern UniversityOwner and Senior Technical Trainer at http://eglobiotraining.com/Email Address: erwin_globio@yahoo.comSkype Id: erwinglobio
    • http://eglobiotraining.com/