2 Replies Latest reply: Mar 21, 2012 3:11 AM by 907439 RSS

    Shareable Interface Object's method in SIM toolkit application

    907439
      The parameter of SIO-method is global apdu-array. Is it possible to transfer this array in processToolkit method to allow SIM-application receives data from other applet? Or may be SIM Toolkit interface has some global array in which SIM-method could copy some data?

      Example:

      Shareable Interface

      public interface ServerInterface extends Shareable {

      short getBytes(byte[] buf, short offset);
      }

      Server applet:

      public class ServerApplet extends Applet implements ServerInterface{
      .....
      public short getBytes(byte[] buf, short offset) {
      return Util.arrayCopyNonAtomic(byteArray, (short)0, buf, offset, (short)byteArray.length);
      }
      }

      ClientApplet:

      public class ClientApplet extends Applet implements ToolkitInterface, ToolkitConstants {
      .....................
      public void processToolkit(byte event) {......}

      private void getBytes(ProactiveHandler proHdlr){
      serverAppletAid = JCSystem.lookupAID(SERVER_APPLET_AID_VALUE, (short) 0,(byte) SERVER_APPLET_AID_VALUE.length);
      serverSIO = (ServerInterface)JCSystem.getAppletShareableInterfaceObject(serverAppletAid, (byte)0);
      short length=serverSIO.getBytes(temp, (short)0);
      displayText(temp, length, proHdlr);
      }
      }

      This example doesn't work because "temp" is transient array in SIM application.
      Manu thanks