Personal Basis Profile
Personal Basis Profile
-
This profile provides two major features
-
Support for basic GUI functionality
-
Lifecycle management of applications
-
The GUI functionality is provided by a subset of the AWT, without
most of the widgets
-
A basic lifecycle model to start, stop, suspend and resume applications
is supported using Xlets
-
The Sun Personal Basis distribution includes a Programmer's Guide
An AWT application
An application to show a button and print a message when pressed is
This application will not work in Personal Basis Profile, because there is no
Button
object
Converting to an AWT application that works under PBP
-
The PBP has the
Frame
widget, all of the AWT events and
AWT listeners, and the AWT geometry managers
-
It has graphics objects, and basic drawing functions
-
It doesn't have the widgets such as the
Button
-
All that is needed (:-) is to define your own widgets, and write code for them
An AWT application working under PBP
To compile the demo
javac -classpath .:/usr/local/personaljava/j2me-pp1.0/lib/personal.jar *.java
To run the demo
/usr/local/personaljava/j2me-pp1.0/bin/cvm PPButtonDemo
Xlets
-
An ordinary application has a
main()
method, and is started by calling
this method
-
The life cycle of an application is start - stop
-
A downloadable application may have further stages
-
download from some source
-
initialise the application
-
start the application
-
suspend the application
-
restart the application
-
stop the application
-
discard the files
-
The life-cycle of a downloadable application should include the
environmental aspects in which it appears to "start - stop"
-
These applications are managed applications
-
An Xlet is the PBP managed application type
Xlet life-cycle
Xlet interface
An Xlet is informed about each state change, as the management environment
calls the methods of the Xlet interface
Xlet example
An example using the PPButton
is
To run the Xlet
cvm com.sun.xlet.XletRunner -name XletButtonDemo -path .
Xlet communication
-
Xlets controlled by the same manager can get references to each other
using the
IxcRegistry
-
Xlets can then call methods on each other
-
e.g. a Timer Xlet running on a TV can ask the current display Xlet to show
a different program
Jan Newmarch (http://jan.newmarch.name)
jan@newmarch.name
Last modified: Fri Dec 3 19:33:17 EST 2004
Copyright ©Jan Newmarch