Overview of Java SIM gsm03.19

Source: Internet
Author: User

Sun gave out the specification of the jcdk (2.2.1 or 2.2.2), ETSI gave out the specification Java SIM gsm03.19. gsm03.19 encoded the Java package SIM. access and SIM. toolkit, with the sim. access, we can access the GSM data and file system, compliant to the gsm11.11. with the sim. toolkit, we can handle the TLV input and output from the SIM card, which is compliant to the gsm11.14, in one word, by using gsm03.19, we can do all the things Native STK program previusly can do. let's have a brief overview about this.

 

First we have to import the package.

Import Sim. toolkit .*;
Import Sim. Access .*;
Import javacard. Framework .*;

Easy example about the sim. Access

 

Declare the simview instance, Sim. Access. simview, the Instance name is gsmfile.

Private simview gsmfile;

If we want to read the SMSP (the SMS center, 6f42) in the SIM card, we can do as below,

Gsmfile. Select (simview. fid_df_telecom );
Gsmfile. Select (simview. fid_ef_smsp );
Gsmfile. readrecord (short) 0x01, (byte) 0x04, (short) 0x18, alphalength, (short) 0x00, (short) 0x01 );
Gsmfile. readrecord (short) 0x01, (byte) 0x04, (short) 0x19, bytearraybuffer, (short) 0x00, (short) (alphalength [0]);

The SMSP will be stored in the byte array 'bytearraybuffer' which was declared in advance.

Easy example about the sim. Toolkit

Declare the handler instance,

Proactivehandler prohdlr = proactivehandler. getthehandler ();

We can construct sms apdu by below methods,

Prohdlr. INIT (byte) pro_assist_send_short_message, (byte) 0x00, (byte) dev_id_network );
Prohdlr. appendarray (alphabuffer, (short) 0x0, (short) 0x2 );
Prohdlr. appendtlv (byte) (toolkitconstants. tag_address), bytearraybuffer,
(Short) 0, (short) (alphalength [0]);
Prohdlr. appendtlv (byte) (toolkitconstants. tag_sms_tpdu), tpdu,
(Short) 0, (short) (bytebuffer ));
Prohdlr. Send ();

There are 6 handler we can use in gsm03.19, we can find more detail in the specs, here give the inheritance structure of the 6 handler.

java.lang.Object
  |
  +--sim.toolkit.ViewHandler
        |
        +--sim.toolkit.EditHandler
              |
              +--sim.toolkit.EnvelopeResponseHandler
 
java.lang.Object
  |
  +--sim.toolkit.ViewHandler
        |
        +--sim.toolkit.EditHandler
              |
              +--sim.toolkit.ProactiveHandler
 
java.lang.Object
  |
  +--sim.toolkit.ViewHandler
        |
        +--sim.toolkit.EnvelopeHandler
 
java.lang.Object
  |
  +--sim.toolkit.ViewHandler
        |
        +--sim.toolkit.ProactiveResponseHandler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.