sim.toolkit
Interface ToolkitInterface
- All Superinterfaces:
- javacard.framework.Shareable
- public interface ToolkitInterface
- extends javacard.framework.Shareable
This interface must be implemented by a Toolkit applet (which extends
the javacard.framework.Applet
class) so that it can be
triggered by the Toolkit Handler according to the registration information.
The Toolkit applet will have to implement the processToolkit shared method
so that it can be notified of the following events :
Event | Description |
EVENT_PROFILE_DOWNLOAD | Terminal Profile command reception |
EVENT_FORMATTED_SMS_PP_ENV | 03.48 formatted envelope SMS-PP Data Download reception |
EVENT_FORMATTED_SMS_PP_UPD | 03.48 formatted Update Record EF SMS |
EVENT_UNFORMATTED_SMS_PP_ENV | Unformatted Envelope SMS-PP Data Download reception |
EVENT_UNFORMATTED_SMS_PP_UPD | Unformatted Update Record EF SMS |
EVENT_UNFORMATTED_SMS_CB | Unformatted Cell Broadcast Data Download command reception |
EVENT_MENU_SELECTION | Envelope Menu Selection command reception |
EVENT_MENU_SELECTION_HELP_REQUEST | Envelope Menu Selection Help Request command reception |
EVENT_CALL_CONTROL_BY_SIM | Envelope Call Control by SIM command reception |
EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM | Envelope MO Short Message Control by SIM command reception |
EVENT_TIMER_EXPIRATION | Envelope Timer Expiration |
EVENT_EVENT_DOWNLOAD_MT_CALL | Envelope Event Download - MT call |
EVENT_EVENT_DOWNLOAD_CALL_CONNECTED | Envelope Event Download - Call connected |
EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED | Envelope Event Download - Call disconnected |
EVENT_EVENT_DOWNLOAD_LOCATION_STATUS | Envelope Event Download - Location status |
EVENT_EVENT_DOWNLOAD_USER_ACTIVITY | Envelope Event Download - User activity |
EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE | Envelope Event Download - Idle screen available |
EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS | Envelope Event Download - Card Reader Status |
EVENT_STATUS_COMMAND | Status APDU command event |
EVENT_UNRECOGNIZED_ENVELOPE | Unrecognized Envelope command reception |
Toolkit applet example :
import javacard.framework.*;
import sim.toolkit.*;
//
// The 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 Also:
ToolkitRegistry
,
ToolkitException
,
ToolkitConstants
Method Summary |
void |
processToolkit(byte event)
This method is the standard toolkit event handling method of a Toolkit applet and
is called by the Toolkit Handler to process the current Toolkit event. |
processToolkit
public void processToolkit(byte event)
throws ToolkitException
- This method is the standard toolkit event handling method of a Toolkit applet and
is called by the Toolkit Handler to process the current Toolkit event.
This method is invoked for notification of registered events.
- Parameters:
event
- the type of event to be processed.- Throws:
ToolkitException
- - See Also:
ToolkitRegistry.getEntry()