


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























1 Application Development for Mobile Devices
Contents What happens when a MIDlet runs? Packaging and deploying a MIDlet Passing properties to MIDlets MIDlet security CLDC
Markus A. Wolf Application Manager MIDlet lifecycle (1) public class LifeCycle1 extends MIDlet { public LifeCycle1() { System.out.println("I'm being born"); } protected void startApp() { System.out.println("I'm being started"); } protected void pauseApp() { System.out.println("I'm being paused"); } protected void destroyApp(boolean param) { System.out.println("I'm being destroyed - aargh"); } } create MIDlet start MIDlet pause MIDlet destroyMIDlet LIfeCycle1.java^4
MIDlet lifecycle (2) active state startApp() (^) pauseApp() destroyed state destroyApp() destroyApp() paused state constructor garbage collected
Quick Quiz Question 1 Which of the following are true statements? By the time a MIDlet's constructor has finished executing the MIDlet will be in the active state. The Application Manager is piece of software written in Java that you download from Sun if you want to run MIDlets on a portable device. A possible sequence of calls to a MIDlet's lifecycle methods is: constructor, startApp(), pauseApp(), startApp(), destroyApp()
Contents What happens when a MIDlet runs? Packaging and deploying a MIDlet Passing properties to MIDlets MIDlet security CLDC
packaging the MIDlet suite MIDlets are deployed in MIDlet suites A MIDlet suite is a collection of MIDlets plus configuration information It consists of: an application descriptor (a JAD file) a JAR file containing the MIDlet .class file(s) and a manifest file MIDlet suite MyMidletSuite.jad MyMidletSuite.jar MyMidlet.class MANIFEST.MF
Converting to PRC format PRC (Palm ResourCe) is a format that allows MIDlets to be installed on PalmOS devices like native PalmOS applications The IBM WebSphere Micro Environment Palm OS Developer ToolKit Jar to PRC tool will create a PRC file from a JAD/JAR file
drag and drop the PRC into the Quick Install application on the PC Hotsync from the PalmOS device
Example of OTA deployment 1 2 3
Contents What happens when a MIDlet runs? Packaging and deploying a MIDlet Passing properties to MIDlets MIDlet security CLDC
Setting and retrieving properties Extract from MIDlet code private String city = "sydney"; private String country ="australia"; public TempInSydney_v2() { โฆโฆ. city = getAppProperty("city"); country = getAppProperty("country"); } JAD file MIDlet-1: TempInSydney, , temperature.TempInSydney_v MIDlet-Jar-Size: 100 MIDlet-Jar-URL: MoreMidletsEgs.jar MIDlet-Name: MoreMidletsEgs MIDlet-Vendor: Unknown MIDlet-Version: 1. MicroEdition-Configuration: CLDC-1. MicroEdition-Profile: MIDP-2. city: lusaka country: zambia (^19)
Contents What happens when a MIDlet runs? Packaging and deploying a MIDlet Passing properties to MIDlets MIDlet security CLDC