midp mobile information device profile johnny yau cis 642 prof. insup lee
TRANSCRIPT
![Page 1: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/1.jpg)
MIDP
Mobile InformationDevice Profile
Johnny YauCIS 642Prof. Insup Lee
![Page 2: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/2.jpg)
Introduction MIDP = Mobile Information Device
Profile Spearheaded by Sun, Motorola, and
Nokia Latest attempt by Sun to bring JAVA
into embedded systems, specifically mobile phone
![Page 3: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/3.jpg)
Motivation Behind MIDP Heterogeneous development
platforms in mobile phone arena Short product life cycles MIDP attempts to solve that via
offering a standard environment for application programmers
![Page 4: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/4.jpg)
What is MIDP? Set of JAVA APIs Implements a MIDlet class Addresses issues such as user
interface, persistent storage, networking, and application model
Targeted towards mobile phones Basically JAVA for mobile phones
![Page 5: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/5.jpg)
Implementation Stacked on top of Connected Limited
Device Configuration (CLDC) and KVM
![Page 6: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/6.jpg)
Implementation (cont) Operates over existing network
protocols such as IrDA, Bluetooth, IEEE 802.11, and wireless networks
Specifications are targeted towards mobile phones
Other devices such as PDAs may find more use in a super set of the MIDP APIs
![Page 7: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/7.jpg)
Service Model
![Page 8: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/8.jpg)
Retrieval Medium Verification
Figure out which communication device to use (e.g. Bluetooth or IEEE 802.11)
Negotiations
![Page 9: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/9.jpg)
Negotiations Server and mobile device exchange
information about the MIDlet and mobile device, respectively
Information such as device capabilities (e.g. processing power, volatile memory available), device size, MIDlet requirements may be exchanged
![Page 10: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/10.jpg)
Negotiations (cont) Crux of the useful capabilities
offered by MIDP Especially important when it comes
to making things work over devices with different sized screens and different capabilities
![Page 11: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/11.jpg)
Installation Download Security Verification
Check that the MIDlet does not violate security issues
Transformation Convert public representation to
internal representation
![Page 12: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/12.jpg)
Launch When selected by user application is
moved into KVM and run
![Page 13: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/13.jpg)
Upgrade & Removal Applications can be upgraded when
new versions become available An application permanently stored
locally on device can be removed from persistent storage when selected for removal by user
![Page 14: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/14.jpg)
Provided by Mobile Device Classes and native code that
implements CLDC JAVA Virtual Machine (KVM) Native code for the MIDP
![Page 15: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/15.jpg)
Provided by JVM & CLDC Multi-threading Locking Synchronization Execution of byte code Method dispatching
![Page 16: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/16.jpg)
MIDlet Class All MIDP applications MUST inherit
from the MIDlet class Does not have a main() function Cannot call System.exit()
It triggers a SecurityException to be thrown
![Page 17: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/17.jpg)
JAVA Packages java.lang.* java.io.* java.util.* javax.microedition.io.* javax.microedition.ui.* javax.microedition.rms.* javax.microedition.midlet.*
![Page 18: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/18.jpg)
javax.microedition.io StreamConnection
To open a basic connection that reads/writes simple data.
ContentConnection To open a connection that provides
content length, type, and encoding information. This interface extends from the StreamConnection interface.
![Page 19: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/19.jpg)
javax.microedition.io HttpConnection
To open a connection that provides capabilities to interface through HTTP including getting/setting headers and HTTP-specific handling. This interface extends from the ContentConnectioninterface.
![Page 20: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/20.jpg)
javax.microedition.ui Offers two major choices in interface
design Canvas
Used to construct a custom interface using the Graphics object
Mainly used for multithreaded games or non-traditional interfaces
![Page 21: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/21.jpg)
javax.microedition.ui Screen
For the construction of form based user interfaces
![Page 22: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/22.jpg)
javax.microedition.rms Contains the classes needed to
implement a temporary storage database on the device
Limited in capabilities because of the restrictions imposed by mobile phones
![Page 23: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/23.jpg)
javax.microedition.midlet MIDlet
Used to build MIDP applications
![Page 24: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/24.jpg)
Hello World MIDletimport javax.microedition.midlet.*; import javax.microedition.lcdui.*;
public class HelloMidlet extends MIDlet implements CommandListener { // Initialize the Midlet Display variable private Display midletDisplay;
// Initialize a variable for the doneCommand private Command doneCommand;
public HelloMidlet() { // Retrieve the display from the static display object midletDisplay = Display.getDisplay(this);
// Initialize the doneCommand doneCommand = new Command("DONE", Command.SCREEN, 1); }
![Page 25: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/25.jpg)
/** * Create the Hello Midlet World TextBox and associate * the exit command and listener. */ public void startApp() { // Create the TextBox containing the "Hello Midlet World!!" message TextBox textBox = new TextBox("Hello Midlet", "Hello Midlet World!!", 256, 0);
// Add the done Command to the TextBox textBox.addCommand(doneCommand);
// Set the command listener for the textbox to the current midlet textBox.setCommandListener( (CommandListener) this);
// Set the current display of the midlet to the textBox screen midletDisplay.setCurrent(textBox); }
/** * PauseApp is used to suspend background activities and release * resources on the device when the midlet is not active. */ public void pauseApp() { }
![Page 26: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/26.jpg)
/** * DestroyApp is used to stop background activities and release * resources on the device when the midlet is at the end of its * life cycle. */ public void destroyApp(boolean unconditional) { }
/* * The commandAction method is implemented by this midlet to * satisfy the CommandListener interface and handle the done action. */ public void commandAction(Command command, Displayable screen) { // If the command is the doneCommand if (command == doneCommand) { // Call the destroyApp method destroyApp(false);
// Notify the midlet platform that the midlet has completed notifyDestroyed(); } } }
![Page 27: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/27.jpg)
Screenshot
![Page 28: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/28.jpg)
Development Cycle Write application using MIDP APIs Compile Pre-verify
Pre-processes the class for use in KVM Test Package classes into a .jar file Test with Package
![Page 29: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/29.jpg)
Hits Simpler development Runs on acceptably well on
heterogeneous platforms
![Page 30: MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee](https://reader035.vdocument.in/reader035/viewer/2022062417/5518bcfe550346b31f8b53d9/html5/thumbnails/30.jpg)
Misses Too bloated really for mobile phones Not powerful enough for devices like
PDAs and Wireless Internet Appliances that have more resources available Though a superset of the APIs may
work fine