Memory optimization in sim toolkit applet

Dear all
i am developing one sim toolkit application.
i am dispalying text on ME screen like this:
name
abcxyz(taking user input using GET INPUT)
password
abcxyz(taking user input using GET INPUT)
bank
ICICI(according to menu selection from user)
for this ,i am copying all this information in one array using
util.arraycopy
and then displaying all this info using
proHdlr.initdisplaytext
i am declaring all arrays (whose content is not going to be changed like name ,password and bank as
global) and all other arrays as transient.
There is some kind of memory leak in aplication ,due to this my application runs for
some(20 or 25) times and then it crash.(to make it work again i have to load it again on sim)
is it necessary to free merory allocated by transient array? or it will released automatically after its use.
// code for ur reference in which memory leaks is here
confirm1 = JCSystem.makeTransientByteArray((short)65, JCSystem.CLEAR_ON_RESET);
//buffer and tempBuffer are also transient arrays in which name and password from
proactive command GET INPUT are stored.
     len = 0;
     Util.arrayCopy(name, (short)0, confirm1, (short)0, (short)name.length);
     len += name.length;
     Util.arrayCopy(newLine, (short)0, confirm1, (short)len,(short)newLine.length);
     len += newLine.length;
     Util.arrayCopy(buffer, (short)0, confirm1,(short)len ,(short)l);
     len += l;
     Util.arrayCopy(newLine, (short)0, confirm1, (short)len,(short)newLine.length);
     len += newLine.length;
     Util.arrayCopy(password, (short)0, confirm1, (short)len, (short)password.length);     len += password.length;
     Util.arrayCopy(newLine, (short)0, confirm1, (short)len,(short)newLine.length);
     len += newLine.length;
     Util.arrayCopy(tempBuffer, (short)0, confirm1, (short)len, (short)j);
     len += j;
     Util.arrayCopy(newLine, (short)0, confirm1, (short)len, (short)newLine.length);
     len += newLine.length;
     Util.arrayCopy(bank, (short)0, confirm1, (short)len, (short)bank.length);
     len += bank.length;
     Util.arrayCopy(newLine, (short)0, confirm1, (short)len, (short)newLine.length);
     len += newLine.length;
     Util.arrayCopy(card, (short)0, confirm1, (short)len, (short)card.length);
     len += card.length;
     ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
     proHdlr.initDisplayText((byte)0x81, DCS_8_BIT_DATA, confirm1, (short)0x0000, (short)len);
     proHdlr.send();
//end of code
any other way of performing same functionality?
Thanx in advance.
Regards
Divyesh

As you have written beforehand: the API provides no possibility to issue directly a VERIFY PIN. The only possibility would be to check the user entered pin against the pin stored in the corresponding EF. But when i remember correctly: the EFs storing the card holder verification values are protected by NEVER (read AC), aren't they? Check the 11.11. Or ask your Schlumberger support for proprietary solutions, if they are available.
So you've got to find a workaround: another EF storing the same value which would rise some security concerns for your customer or storing the pin once at the first application startup (after the user entered it).
The solution with sending APDUs directly to the card will not work in a ME (the ME would have to select your application and i don't know any ME which would do that ;o) That would only be possible at your PC in a card reader.

Similar Messages

  • Java card Applet and sim toolkit applet

    What is Difference between this two?
    When i load java card applet on sim ,then applet is not visible on GSM phone. But sim toolkit Applet is visible on GSM phone.
    i think,SIM uses sim.toolkit ad sim.access to interact with Applet.
    is it so?
    Plz solve my query.
    Thankx 4 ur valuable time.
    Regards
    Divyesh.

    for programming in sim card, you must use necessarily sim toolkit applet.
    I thing that the difference between Javacard applet and Simtoolkit applet is that:
    - sim toolkit applet is only for sim card
    - java card applet is for another smart card
    of course, both have some joint things.

  • Events in a SIM toolkit applet

    Hi,
    I am looking at some sample (and simple) code:
    public MyApplet() {
              // Define the applet Menu Entry
              idMenu1 = reg.initMenuEntry(Menu1, (short) 0, (short) Menu1.length,
                        PRO_CMD_SELECT_ITEM, false, (byte) 0, (short) 0);
              // Define the Unformatted SMS PP event that trigger the applet
              reg.setEvent(EVENT_UNFORMATTED_SMS_PP_ENV);
    public void processToolkit(byte event) {
              EnvelopeHandler envHdlr = EnvelopeHandler.getTheHandler();          
              if (event == EVENT_MENU_SELECTION) {
                   byte selectedItemId = envHdlr.getItemIdentifier();
                   if (selectedItemId == idMenu1) {
                        menu1Action();
              if (event == EVENT_UNFORMATTED_SMS_PP_ENV) {
                   UnformattedSmsPpAction();
    In processToolkit we procees EVENT_MENU_SELECTION and EVENT_UNFORMATTED_SMS_PP_ENV, yet in the ctor we subscribed only for the latter. Does that mean that it is not necessary to subscribe to EVENT_MENU_SELECTION and that this event is always delivered to the applet (that created the menu)?

    For UICC, SIM etc check this link: [http://en.wikipedia.org/wiki/UICC]
    For ETSI, 3GPP etc., this is where it gets confusing, you should do the research for yourself. As for using the latest specification, you actually want to use the specification your card complies to, i.e. if the card is old it may not comply with the latest specifications.
    Regarding Java applets and toolkit applets:
    To send commands to a Java applet you first select (see GlobalPlatform standard) it and then you send it some APDUs as specified in the 7816-4 and GlobalPlatform standards. You can also implement custom APDUs that only your applet will recognize.
    The toolkit applets are Java applets, you can send them APDUs (first you select them) as well. The difference is that toolkit applets can also receive events from the mobile phone like SMS received or user selected some menu. You can also send commands to the phone to display text, menus etc.
    A Java applet can do what a toolkit applet does, but to implement it yourself you be very hard. The Java API that is used in toolkit applet programming provides facilities to (for example) show something on the phone's display without sending and receiving heaps of APDUs.
    If your card will be used in a mobile phone then you write a toolkit applet (to which you can still send APDUs if you have to). If your card will be used for something else, like access card or a bank card then you don't need toolkit applet functionality.
    The biggest problem with this technology that there are almost no books, only the standards, which you do have to read, and forums.

  • SIM Toolkit Applet

    Hi! I am a Java card programmer and i have worked with Java card 2.1.1 and 2.2.1. now, we are going to have a mobile banking project. but i dont know anything about that. so if i am asking funny questions, dont laugh at me!:)
    - i dont know whats the difference between SIM card and the regular Java cards?
    - am i able to use regular JAVA card 2.2.1 to use for this purpose?
    - i dont know whats the difference between SIM and USIM?
    - i have found some sample SIM applet, which use sim.toolkit,sim.access / uicc.toolkit,uicc.access, but i dont know where can i find these packages! for JCDK, we have downloaded it from Oracle(SUN) , but for this?
    - can i use my regular reader to work with my card or i should put it on a mobile or a simulator?
    please help me! i really need your help! :(
    Narges

    For UICC, SIM etc check this link: [http://en.wikipedia.org/wiki/UICC]
    For ETSI, 3GPP etc., this is where it gets confusing, you should do the research for yourself. As for using the latest specification, you actually want to use the specification your card complies to, i.e. if the card is old it may not comply with the latest specifications.
    Regarding Java applets and toolkit applets:
    To send commands to a Java applet you first select (see GlobalPlatform standard) it and then you send it some APDUs as specified in the 7816-4 and GlobalPlatform standards. You can also implement custom APDUs that only your applet will recognize.
    The toolkit applets are Java applets, you can send them APDUs (first you select them) as well. The difference is that toolkit applets can also receive events from the mobile phone like SMS received or user selected some menu. You can also send commands to the phone to display text, menus etc.
    A Java applet can do what a toolkit applet does, but to implement it yourself you be very hard. The Java API that is used in toolkit applet programming provides facilities to (for example) show something on the phone's display without sending and receiving heaps of APDUs.
    If your card will be used in a mobile phone then you write a toolkit applet (to which you can still send APDUs if you have to). If your card will be used for something else, like access card or a bank card then you don't need toolkit applet functionality.
    The biggest problem with this technology that there are almost no books, only the standards, which you do have to read, and forums.

  • 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

  • Modifying Memory Optimization parameter for BPEL process in SOA 11g

    Hello
    I have turned on memory optimization parameter for my BPEL process in the composite.xml (11g)
    this is what I have in composite.xml:
    <property name="bpel.config.inMemoryOptimization">false</property>
    How do we modify this parameter in the EM console at runtime? I changed this property to "true" using the System MBean browser, but it wasn't taking effect. I thought the SOA server must be restarted (similar to what we used to do in 10g). But when I restart the SOA server, the parameter goes back to whatever the value was in the composite.xml ignoring the change I made in the System MBean browser
    Please share your thoughts.
    Thanks in advance.
    Raja

    Deploying a newer version is not an option, as the endpoints could change (not sure if it would in 11g, but in 10g it does) and also, our service consumers will be pointing to the older version.As mentioned above, if clients are using URL without version then call will be forwarded to default version of composite internally. No manual tweaking required for this. Just make sure that while deploying the new version you are marking it as default.
    Besides, we report on service metrics and having multiple versions just complicates things.Not at all. If you are not using versioning feature, you are really under utilizing the Oracle SOA 11g. Remember that metrics can be collected for a single composite with same effort, irrespective of the number of composite versions deployed. Only few product tables refer the version while storing composite name and rest all use only the composite name without version. I do not know how you are collecting service metrics but we use DB jobs for same it works perfectly with any number of composites having multiple versions deployed.
    The idea is to do some debugging and collect audit trail in case there is a production issue by disabling inMemoryOptimization parameter. This is a live production environment and deploying whenever we want is not even an option for us, unfortunately. Why not debug by increasing log level. Diagnostic logs are the best option to debug an issue even in production. For getting audit trail you may re-produce the issue in lower environments. I think no organization will allow re-deployments just for debugging some issue in production until and unless it is too critical issue to handle.
    Does this not supported in 11g? if it isn't, it does seem like a bug to me. You may always go ahead and raise a case with support.
    Regards,
    Anuj

  • Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet

    Dear Friends,
    I am new to java card development.
    Is it possible or what is Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet?
    Is it feasible to do so? Suppose if we write one application using java card to do so and then will load the applet into Smart card(Java Card).
    Any sugestion will be highly appreciated and will of great help.
    Thanks in advance for the response.
    Regards,
    Sunil K

    Dear Friends,
    I am new to java card development.
    Is it possible or what is Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet?
    Is it feasible to do so? Suppose if we write one application using java card to do so and then will load the applet into Smart card(Java Card).
    Any sugestion will be highly appreciated and will of great help.
    Thanks in advance for the response.
    Regards,
    Sunil K

  • JAVA Sim Toolkit (STK)

    I have good experience in JAVA card programming, however SIM is a whole new world for me.
    Anyone please can indicate to me what the following means???
    [electrical profile, ICCID, IMSI and Ki. The IMSI and Ki is mandatory ! others optional.]
    The application i am trying to develop uses the Mobile phone STK functionality to display information on the screen only! and in no case does it access the GSM network and even doesnt need to register.
    Are the above parameters still required? if so how do we get them? i assume there is a regulatory body that provides them?
    thanks

    Hi,
    ad 2. SIM Application Toolkit as defined in gsm 11.14
    (www.etsi.org) is just a definition of framework and
    commands as extension to ME<->SIM protocol. There is
    more or less defined API for the protocol for
    JavaCard, but it is just the Java way and different
    SIM vendors offer different things. Further real
    JavaCard
    STK implemenattions may vary, see www.simalliance.org
    for certification effort.
    (As of MS they pushed some own technology for SIM
    cards but I haven't heard anybody ever used it. )
    ad 1. You can use sun javacard tools for devel. For
    deployment be warned to enter world of NDAs
    and not an easy work with operators. Only operator can
    deploy application on the SIM card.
    The only other way how to deploy STK application
    without operator I know of is the turbo accessory. It
    uses
    the GNU C compiler and tools. You can find the API at
    http://www.bladox.com/devel-docs/index.html
    (there is also light intro to sim toolkit).
    FPThat means STK is just a protocol like TCP that programer can develop their program using winsock or java.net package. The server and client sides communicate each other using TCP as ME and SIM using STK. Is this right??
    Actually, i am more concerned for phone aspect. How can i develop a program or routine to communicate with application in SIM card and get the information in SIM card like additional service. And i can present it as a menu on the phone. I have no idea to do this thing!!
    thanks and appreciate your answer~~

  • Help with SIM Toolkit

    Hi,
    I'm new to java card area. I'm programming with SIM Toolkit . Actually I want to get the IMEI of the handset with the Proactive Command "PROVIDE LOCAL INFORMATION".
    Also i am using the Gemalto developer suite for this. Can someone provide a sample application for this? Any pointers will be very helpful.
    Thanks & Regards,
    Dhanya

    Hi,
    I'm new to java card area. I'm programming with SIM Toolkit . Actually I want to get the IMEI of the handset with the Proactive Command "PROVIDE LOCAL INFORMATION".
    Also i am using the Gemalto developer suite for this. Can someone provide a sample application for this? Any pointers will be very helpful.
    Thanks & Regards,
    Dhanya

  • N900 can not MOBILE BANKING through SIM TOOLKIT

    N900 can not Mobile banking through SIM TOOLKIT, because NOT support SIM TOOLKIT.
    EVEN AFTER UPDATE 10.2010.19-1 (last update).

    yes, I agree "FANCY" N900 less fancy without this service.... I really disapointed because if NOKIA 900 can use STK and Browser, we can choose the way that we love to use, right?
    now, "FANCY" Mobile PUSH
    romanf wrote:
    SIM TOOLKIT (STK) is need just for authorization (not only in Mobile Banking), Authorization system build on STK is handy and very secure.
    There is short animation that shows how it looks like: http://www.id.ee/public/Mobiil_ID_animation/
    Today STK is already realized on almost all mobile phones, but not on "fancy" Nokia N900. 

  • Ki for SIM card applet installation

    Hi
    How can i found/generate Ki for installation of a STK applet on SIM card ??

    You don't need a special sim card reader.
    Any ISO compliant smart card reader plus an sim-adaptor (from from factor ID-000 to ID-1) will do the job, because the only difference is the size of the plastic around the chip.
    Jan

  • [iPhone] UIWebView memory optimization

    As we know the iPhone will keep Safari running in the background which usually consumes about 17-24 MB of the ram at any given time.
    If I have an application that opens a view that is basically a UIWebView with a URL loaded to it, it seems to take about 15 MB of ram to do this.
    Is there any way to load a UIWebView and not take up so much of the system RAM to do it? All I am doing it a:
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:myURL]];
    Does anyone have experience trying to optimize memory usage with a UIWebView?
    Thanks

    Ideas anyone?

  • Big arrays + graphics : did memory optimization reach the limit?

    Hello all,
    Please if you have time consider this program situation and please propose anything that might reduce ressources:
    Program: application to analyse data from files
    input:
    12files (12 month = 1 year data) to 10 years.
    about 30000 rows for 5 columns (4 double, 1 String)
    output:
    graphs of data (4 graphs per dataset - 12 files). datasets can be graphed at the same time.
    I store the data from files into 2D arrays in order to gain in memory usage. But still when I load more than 2 datasets it consumes 140 Mo from my 256 Mo, and 60% CPU speed (info from task manager, and I also check through Runtime). Yet I have to process the data and chart it, so I guess I already consume a lot of memory.
    I already use threads and the option -Xmx256m.
    I cannot divide data processing since I have to chart them into 1 year graph.
    Please do you have any programmatic/logic solution for ressource optimization?
    Thank you very much
    Khalil

    Please do you have any programmatic/logic solution for
    ressource optimization?You could use float internally. That would reduce the 4 doubles to four floats (a float is only half a double). Do you really need all the Strings in memory at all times. I mean how many of them can you actually display on the screen at the same time. Also remember the screen resolution is limited to something like 1000 pixels. This means you probably don't need the full dataset in memory at all times because you can't show fractions of pixels anyway.

  • Java Memory Optimize

    Dear all,
    I want to store large data on memory.
    Could you show me the way to optimize data for storage on memory?
    Thank a lot for support.
    Best regards,
    VKnight

    Thanks for your replies.
    Perhaps, I should ask more detail.
    I want to store point (or score) of each application of member.
    class ApplicationPoint{
         byte applicationId;
         long point;
    class Member{
         int memberId;
         List<ApplicationPoint> points;
    }Then I use a HashMap to store the Member object.
    When storage data for 100.000 members, each member contains 100 applications (List<ApplicationPoint> has 100 item), the memory consume 340MB.
    But I want to store for 3.000.000 members to 10.000.000 members.
    Cound you give some advice?
    Thank a lot for support.
    Best regards,
    VKnight

  • Can the J2ME access through the SIM toolkit application?

    im a new to this.. can that be possible?
    im about to develop an application that would access the program on the SIM. would that be possible with java?
    tnx...

    reply plsss... hehehe i need help

Maybe you are looking for

  • Creation of a new Authorization object

    Hi , I need to create a new Authorization group and add three existing tables to it. Kindly suggest a way. Regards.

  • End User Experience Monitoring Querries

    Dear Experts, I have a doubt in End User Experience Monitoring (EEM), I created a SAP GUI Script that script  execute automatically every day. How to set automatically. Regards Balaji

  • PDF/A and font substitution

    I've embarked on a mission to scan, download, or otherwise capture all of my records as PDF files.  It seems reasonable to me that I want to save them as PDF/A when possible so that they will look exactly the same 20 years from now as they do today. 

  • Why does google chrome freeze and crash after installing mavericks?

    I use google chrome and after installing mavericks my chrome started moving slower and slower until it eventually froze.  The keyboard becomes locked and the mouse is just a pinwheel.  Cannot click on anything or force quit.  I end up powering it dow

  • Can DDoS Attack program in java?

    Can we write powerful and disastrous exploit in Java such as DDOS attack,Sql injection,byte code attack,reversing other language's program? please end up my curiosity by your perfect solution. :) I will godly appreciate that, thanks in advance. :) be