sim.toolkit.ToolkitInterface
he HelloWorld class is a simple Toolkit applet, which may be used as an // example to show how such an applet will be installed and registered and // how it will be triggered. // public class HelloWorld extends Applet implements ToolkitInterface,ToolkitConstants { // data fields private static final byte CMD_QUALIFIER = (byte)0x80; private byte[] menuEntry = {'S','e','r','v','i','c','e','1'}; private byte[] textBuf = {'H','e','l','l','o',' ', 'w','o','r','l','d',' ','!'}; private ToolkitRegistry reg; // // Constructor of applet // public HelloWorld() { // get a Registry object... // ...and initialize it according to the applet characteristics reg.initMenuEntry(menuEntry, (short)0, (short)menuEntry.length, PRO_CMD_DISPLAY_TEXT, false, 0, 0); } // // Install method // *param bArray the array containing installation parameters // *param bOffset the starting offset in bArray // *param bLength the length in bytes of the parameter data in bArray // public static void install(byte bArray[], short bOffset, byte bLength) throws ISOException { // create and register applet HelloWorld HelloWorldApplet = new HelloWorld(); HelloWorldApplet.register(); } // // Process toolkit events // *param event the type of event to be processed // *exception ToolkitException // public void processToolkit(byte event) throws ToolkitException { // get the ProactiveHandler system instance ProactiveHandler proHdlr = ProactiveHandler.getTheHandler(); if (event == EVENT_MENU_SELECTION) { // prepare a Display Text command proHdlr.init((byte) PRO_CMD_DISPLAY_TEXT, (byte)CMD_QUALIFIER, (byte)0x02); proHdlr.appendTLV((byte)(TAG_TEXT_STRINGTAG_SET_CR), textBuf, (short)0, (short)textBuf.length); proHdlr.send(); } } }
@version 8.3.0
@see ToolkitRegistry
@see ToolkitException
@see ToolkitConstants