How to compile and test SIM card applet

Dear all
I have a sample applet:
package sim.access.sample;
import sim.access.*;
public final class helloFile extends Applet implements ToolkitInterface
       private static SIMView  theGsmApplet;
       private static USIMView aUsimApplet;
       private static AID theGSMAppletAID;
       private static AID theUSIMAppletAID;
       private static final byte[]  baGSMAID = {(byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x09,(byte)0x00,(byte)0x01};
       protected helloFile(){
       public MyApplet () {
            theGSMAppletAID = new AID();
            // get a reference to the GSM interface
            theGsmApplet = SIMSystem.getTheSIMView(theGSMAppletAID);
       public void doSomethingWithAFile(){
               // returns the SIMView of the currently selected Applet
               // allows to implement services that are depend on specific
               // file in GSM or USIM application as well as to implement
               // technolgie independent applets.
               SIMView theView = SIMSystem.getTheSIMView();
               if(theView instanceof SIMView){
                    // do something with a GSM file
               else if(theView instanceof USIMView) {
                    //do something with a USIM specific file
               // Or request a View to a specific application
               USIMView theView = SIMSystem.getTheSIMView(aUSIMAppletAID);
}I want to compile and test it, how can i do it ???

I am trying to compile it on eclipse using JCOP:
package mytest;
import sim.toolkit.ToolkitException;
import sim.toolkit.ToolkitInterface;
import javacard.framework.APDU;
import javacard.framework.Applet;
import javacard.framework.ISO7816;
import javacard.framework.ISOException;
public class Test extends Applet implements ToolkitInterface{
     public static void install(byte[] bArray, short bOffset, byte bLength) {
          // GP-compliant JavaCard applet registration
          new Test().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
     public void process(APDU apdu) {
          // Good practice: Return 9000 on SELECT
          if (selectingApplet()) {
               return;
          byte[] buf = apdu.getBuffer();
          switch (buf[ISO7816.OFFSET_INS]) {
          case (byte) 0x00:
               break;
          default:
               // good practice: If you don't know the INStruction, say so:
               ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
     public void processToolkit(byte arg0) throws ToolkitException {
          // TODO Auto-generated method stub
}It is giving following error on package name:
resolving constant-pool of clazz Lmytest/Test; failed: missing export file for package sim/toolkit

Similar Messages

  • How to Compile and run Smart Card Application

    hi
    any one can help me reagrding Javacard API. i download the JavaCard Development Kit from sun and install on my machine but i didn't get all java files and class files of JavaCard API. where i obtain those files so my application get compile and run.
    pls help me i m new in this technology.
    Thanks in Advance.

    My program Test.java in F:\Tomcat5\webapps\Ambika\WEB-INF\Classes. I compiled in the format below. I got like this. What should I do for this? But yesterday I compiled like this only, It compiled and the folder com\cert\Test.class is created. Today again I compiled the pgm after deleting the already created folder 'com\cert', I got the error like this.
    I've given my pgm and the thing I've got when I compiled it.
    Test.java
    package com.cert;
    public class Test
         public void display()
              System.out.println("Hai");
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>javac -d F:\Tomcat5\webapps\Ambika\WEB-INF\Classes\Test.java
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are u
    sed
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>
    Plz help me.
    thanks in advance
    Ambika

  • Please help i bought an iphone from ebay and it is unlocked and refirbished by apple how do i know what sim card to buy for it? iPhone 3GS

    please help i bought an iphone from ebay and it is unlocked and refirbished by apple how do i know what sim card to buy for it? iPhone 3G

    Contact your chosen cellular provider to obtain a compatible SIM card.

  • I have iphone5 and my sim card got locked how do i unlock it, says   puk locked

    have iphone5 and my sim card got locked how do i unlock it, says   puk locked

    <http://support.apple.com/kb/ht1316>

  • How can I get a sim card for Japan and will it work with my locked Iphone 6

    How can I get a sim card for Japan and will it work with my locked Iphone 6

    You cannot use a SIM card on a carrier locaked phone, other than a sim from the carrier the phone is locked to. You must first get the carrier it is locked to, to unlock your phone. Apple does not unlock phones.

  • How to configue AirCel prepasd SIM Card and drivers for 8.1 64bit

    Hi Team Members,
    how to configue AirCel prepasd SIM Card and drivers for 8.1 64bit
    issuse in my laptop
    Sarfaraz
    (Personal information removed)

    @Sarfaraz71 ,
    Thank you for posting and the HP support forum and welcome.
    So that I can help you better with your sim card issue.  Could you post back with your.
    Full Model and Product Number
    Second in your post you asked about Windows 8.1 drivers and you state you are running Windows 7. 
    What Operating System are you running.
    Hope to hear back from you soon with the information I have requested.
    Have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • My IPhone4s (cell phone) and my SIM card have destroyed.now I have lost all phone book number. I have just an mini-ipad2 ,it contain just contacts name which I had their email address in my yahoo  Bookmark. how can I restore and reassume my phone numbers?

    The best regards
    DearSir/Madam
    My IPhone4s (cell phone) and my SIM card have destroyed.now I have lost all phone book number. I have just an mini-ipad2 ,it contain notes and just contacts name which I had their email address in my yahoo  Bookmark. how can I restore and reassume my phone numbers?
    Please help me because I need to much to my phone Directory.
    Thank you so much
    Mehran

    mehranheidari wrote:
    Yes I have failed,unfortunately .
    Then from where did you think you could recover your data?

  • How do you remove the SIM card from one iPhone 5 and place it in another?

    how do you remove the SIM card from one iPhone 5 and place it in another?

    With a paper clip?  Refer to the User Guide.

  • HT201328 My iPhone is from Japan and I want to activate it here in the Philippines because I'm living here. I have lost the original SIM from Softbank and replaced it with a new SIM card from Globe. How can I use the SIM card from Globe?

    My iPhone is from Japan and I want to activate it here in the Philippines because I'm living here. I have lost the original SIM from Softbank and replaced it with a new SIM card from Globe. How can I use the SIM card from Globe?

    You cannot. The iPhone is locked to Softbank, and only they can unlock it. Problem is that Softbank will NOT unlock the phone, as they do not offer iPhone unlocking.
    Buy an iPhone in the Phillipines.
    PS Before you go on a rant at Apple, be aware that Apple does NOT unlock phones and they do not set unlocking policies. The carriers (Softbank in this case) set the unlocking policy.

  • How do I install the sim card?

    How do I install the sim card on the 5s?

    Use a paper clip and push it into that hole on the right side of the phone. The SIM container will pop out. Change the SIM and push it in.

  • How to compile and run package programs in Java

    Hi,
    I want to know how to compile and run the package programs in Java using -d. instead of creating the package folder manually.
    eg:
    package Test;
    class test1
    public void disp()
    //Any code;
    I want to compile this without creating the folder ' Test ' manually. that is if we use -d with javac the Test folder will be created automatically. I need the format of -d
    could anyone please help me.
    Thanks in Advance ,
    Ambika

    My program Test.java in F:\Tomcat5\webapps\Ambika\WEB-INF\Classes. I compiled in the format below. I got like this. What should I do for this? But yesterday I compiled like this only, It compiled and the folder com\cert\Test.class is created. Today again I compiled the pgm after deleting the already created folder 'com\cert', I got the error like this.
    I've given my pgm and the thing I've got when I compiled it.
    Test.java
    package com.cert;
    public class Test
         public void display()
              System.out.println("Hai");
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>javac -d F:\Tomcat5\webapps\Ambika\WEB-INF\Classes\Test.java
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are u
    sed
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>
    Plz help me.
    thanks in advance
    Ambika

  • Hello guys,My first time in community.my problem is that my SIM card was working ok and from today at the left of the screen up shows that is searching for the sim.I contacted the carrier and the SIM card shows that is working.Any suggestions?

    Hello guys,My first time in community.my problem is that my SIM card was working ok and from today at the left of the screen up shows that is searching for the sim.I contacted the carrier and the SIM card shows that is working.Any suggestions?

    Hey NicolasZen,
    Thanks for the question and welcome to the Apple Support Communities. I understand that you are experiencing issues with “No Service” or “Searching” on your iPhone. The following resource provides some great troubleshooting steps that you may wish to try:
    iPhone: Troubleshooting No Service
    http://support.apple.com/kb/TS4429
    Your iPhone may have one of these symptoms:
    - iPhone displays "No Service" or "Searching" in an area of good coverage
    - iPhone doesn't regain service when returning to an area of coverage
    Resolution
    If you encounter either of the above symptoms on your iPhone, follow these steps to attempt to resolve the issue. Test after each step.
    1. Toggle airplane mode: Tap Settings > Enable Airplane Mode, wait five seconds, then turn off airplane mode.
    2. Turn iPhone off and then on again.
    3. Remove the SIM card and verify that it's a valid, carrier-manufactured SIM. Also verify that it isn't damaged, worn, or modified. Then reinsert it.
    4. Check for a carrier-settings update. Connect to a Wi-Fi network. Then tap Settings > General > About. If an update is available, iOS will ask you if you want to install it. If Wi-Fi isn't available, connect your device to iTunes.
    5. Update your iPhone to the latest version of iOS.
    6. Reset network settings by tapping Settings > General > Reset > Reset Network Settings. This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings.
    7. Restore the iPhone.
    Thanks,
    Matt M.

  • How can i fix "the sim card inserted in this iphone does not appear to be supported " after restoring a factory unlocked iphone 4

    how can i fix "the sim card inserted in this iphone does not appear to be supported " after restoring a factory unlocked iphone 4

    The term "factory unlocked" has no meaning. Your phone was not legitimately unlocked. Contact the carrier it is locked to and find out if you can get it unlocked.

  • The SIM card In my iPhone 5 has been giving me occasional messages that there has been a SIM Failure, there is NO SIM, or that there is an INVALID SIM.  Until today, I was able to restart it with no problem and the SIM card would start up.

    The SIM card In my iPhone 5 has been giving me occasional messages that there has been a SIM Failure, there is NO SIM, or that there is an INVALID SIM.  Until today, I was able to restart it with no problem and the SIM card would start up.  This afternoon the NO SIM message came up and I cannot fix it. What is my next step?  I am traveling in Canada now and it is not convenient to come back to the States just to get a SIM card.
    Thanks,
    Lou

    Hi,
    Thanks for getting back to me.  How can I initiate Verizon sending me a new SIM card?  I will be here  long enough to receive it if they can send it to me.
    I have been trying to call Verizon Wireless, but they won’t take my call from my Skype account and I don’t have my phone.
    Thanks again,
    Lou

  • How do I use the sim card If its blocked, not because it is brand new, has blocked its carrier when purchased

    How do I use the sim card If its blocked, not because it is brand new, has blocked its carrier when purchased, my uncle bought it from his old friend

    Only the wireless provider to which an iPhone is locked can unlock it. Have
    your uncle's friend contact his wireless provider to see if they offer unlocking
    and if he qualifies. Many wireless providers require that the account be in good
    standing and the iPhone be active on their network for an unlock to proceed.

Maybe you are looking for