How change state when card is inserted and pulled out

It is not Java Card question, but I think it is better place to post question like this. I have running Java Card applet on card, the communication between card and host application works, but could you anybody tell me how handle inserting and pulling card out? My idea is, I have running Java 6 SE application:
1. and I will insert the card into a reader and application will automatically find out that card was inserted and write out it.
2. and I will pull out the card from a reader and application will automatically find out that card was pulled out and write out it.
Could you anybody help me, please?
Thank you very much for any answer.
Martin

mFilo wrote:
It is not Java Card question, but I think it is better place to post question like this. I have running Java Card applet on card, the communication between card and host application works, but could you anybody tell me how handle inserting and pulling card out? My idea is, I have running Java 6 SE application:
1. and I will insert the card into a reader and application will automatically find out that card was inserted and write out it.
2. and I will pull out the card from a reader and application will automatically find out that card was pulled out and write out it.I think you can address only terminals. A way to identify a card is with additional info like ATR, CPLC data or specific applet's file control information (response to select command). I found in javax.smartcardio.CardTerminals following methods that might help:
waitForChange
public void waitForChange()
                   throws CardException
    Waits for card insertion or removal in any of the terminals of this object.
    This call is equivalent to calling waitForChange(0).
    Throws:
        IllegalStateException - if this CardTerminals object does not contain any terminals
        CardException - if the card operation failed
waitForChange
public abstract boolean waitForChange(long timeout)
                               throws CardException
    Waits for card insertion or removal in any of the terminals of this object or until the timeout expires.
    This method examines each CardTerminal of this object. If a card was inserted into or removed from a CardTerminal since the previous call to waitForChange(), it returns immediately. Otherwise, or if this is the first call to waitForChange() on this object, it blocks until a card is inserted into or removed from a CardTerminal.
    If timeout is greater than 0, the method returns after timeout milliseconds even if there is no change in state. In that case, this method returns false; otherwise it returns true.
    This method is often used in a loop in combination with list(State.CARD_INSERTION), for example:
      TerminalFactory factory = ...;
      CardTerminals terminals = factory.terminals();
      while (true) {
          for (CardTerminal terminal : terminals.list(CARD_INSERTION)) {
              // examine Card in terminal, return if it matches
          terminals.waitForChange();
    Parameters:
        timeout - if positive, block for up to timeout milliseconds; if zero, block indefinitely; must not be negative
    Returns:
        false if the method returns due to an expired timeout, true otherwise.
    Throws:
        IllegalStateException - if this CardTerminals object does not contain any terminals
        IllegalArgumentException - if timeout is negative
        CardException - if the card operation failed

Similar Messages

  • How to get count of records inserted and errored out in an email

    Hi
    I have following question
    I want to send report statics of scenario i.e Number of rows inserted during the scenario and
    Number of rows in error in the scenario in an email.Here in my scenario I am trying to insert data into Essbase database and when i try to use getNbInserts() and getNbErrors functions of ODI in an email body,its giving zero value even though there 140 records inserted and 10 errored out.Can any one let me know how we get this number of records inserted and number of records errored in email.
    Thanks in advance
    Regards
    Baji

    Hi
    I have following question
    I want to send report statics of scenario i.e Number of rows inserted during the scenario and
    Number of rows in error in the scenario in an email.Here in my scenario I am trying to insert data into Essbase database and when i try to use getNbInserts() and getNbErrors functions of ODI in an email body,its giving zero value even though there 140 records inserted and 10 errored out.Can any one let me know how we get this number of records inserted and number of records errored in email.
    Thanks in advance
    Regards
    Baji

  • I had to change my sim card due to call drop outs and now i have lost important voice messages. How do i get the messages back?

    Please help. I lost very important voicemail when i changed my sim card due to call drop out. How do i get my voicemail back??

    If you mean that Find My Phone is asking for a password to a different Apple ID to your current Apple ID and that ID is a previous version of your current ID, not an entirely different one.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details and some other circumstances.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone" and delete the account from your device. It may take a short while to remove the account.
    You should then change your Apple ID back to its current state, save it once again and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and tested on: 2014/05/23

  • HT201303 Hi trying to change my credit card on file and it won't let me

    Hi,
    Trying to change my credit card on file and it won't let me.

    Why won't it let you? Is there an error? More information is needed to assist you.

  • How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database

    How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database table) using Dreamweaver’s Repeat Region. Example: I have different products each one associated (through their productID) with two images (one that’s showing in the page and one for the rollover effect) that are pulled from a database using Dreamweaver’s Recordset. So I want to end up with a page containing row after row of images(one for every product).When moused over each image will reveal the second (rollover) image for the same product which in turn can be a link(the image itself ) that when clicked leads to a detailed page with more information about the product the image is associated with. To show row after row with images for the different products in the database table I am using Dreamweaver’s Insert Rollover Image command and then the  Repeat Region – I have no problem to complete the steps, to insert the image and the rollover one at once and set the paths so they are pulled dynamically depending on the productID they are associated with .I have also no problem to apply the Repeat Region so not only the first image associated with the first product in the table is shown but all of them-a routine and standard procedure when using the Repeat Region to dynamically generate and display multiple rows of data. However, when I preview the page the rollover effect is lost –the images are shown but when moused over the second  image does not  show. The problem is caused when the Repeat Region is applied-once again I am allowed to apply it but the rollover stops working, a kind of interference. ANY SOLLUTION PLEASE, ANY WORK AROUND.

    I gotta tell you, using multiple images for rollover effects is going to be a big challenge in your dynamic scenario. 
    If this were my product page, I would use thumbnails with a bit of CSS opacity or filters to desaturate and make them full opacity/color on mouse over.  Nice effect with much less bandwidth. Easily done globally with CSS code.
    Two examples:
    http://alt-web.com/GALLERY/GalleryTest.php
    http://alt-web.com/TEMPLATES/CSS-Semi-liq-photo-sheet.shtml
    Nancy O.

  • My I-Pad screen is black, I tried to sync and restore I-Pad, it showes the contents on the computer and pulling out pictures and other files, but screen is black. what can I do?

    My I-Pad screen is black!! I tried to sync and restore I-Pad, it showes the contents on the computer and pulling out pictures and other files, but screen is black. I don't know what happened! what can I do?

    I have this problem as well...however, resetting/restoring did not take place when I followed the same instructions but got nothing on the screen.  Thanks in advance.

  • How do i make flyers in Pages with pull out phone #'s?

    how do i make flyers in Pages with pull out phone #'s and Photos?

    Ask the experts:
    https://discussions.apple.com/community/iwork/pages

  • Why when I change my debit card banking details and the postal code of where I stay is rejected,yet I know it is the correct postal code?please HELP me.

    Why is it that when I'm changing my debit card details and my postal address I receive a message that says my postal code is not valid?and yet I'm certain of what my postal code is.Please help.Regards,

    Ztshosane wrote:
    ... I receive a message that says my postal code is not valid?...
    Try here  >  http://support.apple.com/kb/TS1646
    If necessary... Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Invalid cursor state when trying to insert record

    Hi everyone!
    I'm using JDBC-ODBC bridge to connect to a mySql database, which works fine. Then I try to insert new records, but this only works for the first record in the table.
    When there is already a record in the table, I always get "[Microsoft][ODBC Driver Manager] Invalid cursor state" when calling the updateRow()-method of the result set.
    Here is my code:            // open db connection
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection conn = DriverManager.getConnection("jdbc:odbc:TTManager", "xxxx", "xxxx");
                // Prepare SQL statement
                java.sql.Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                ResultSet result = stmt.executeQuery("SELECT * FROM Player");
                result.moveToInsertRow();Then all fields are filled in this manner:            result.updateString("Name", name);And finally the insertRow should be written to the db:            result.insertRow();But at this point it gives the mentioned error, including these messages:         at sun.jdbc.odbc.JdbcOdbcResultSet.setPos(JdbcOdbcResultSet.java:5272)
            at sun.jdbc.odbc.JdbcOdbcResultSet.insertRow(JdbcOdbcResultSet.java:4132)Since I'm very unexperienced with Java, I guess (or hope^^) it's just some stupid beginner's mistake.
    Oh, almost forgot to mention: The new record's data doesn't violate any unique-constraints on the table, all fields are explicitely filled and all variable's data types are matching their according field types!
    Any help would be appreciated!
    reinski

    Ok, I needed to help myself and this is what I found out:
    If the table already contains records, it is not enough to doresult.moveToInsertRow();but I must beresult.last();
    result.moveToInsertRow();I didn't find any explanation and even the code examples from the Sun tutorial don't mention this, so I guess it's a bug occurring in my poor IT environment: DB server running mySQL 5.0.0-alpha on a P1-233-MMX w/ 64MB under WinNT4 (hey don't laugh!!^^).
    Maybe this information is of use to someone having similar problems...
    Greetings!
    reinski

  • I can't change about credit card for update and download

    I would like to update and download , right now i have problem , can't change credit card for buy item , app., and can't update and download, please help me  or How do i do?

    If you tried to change through the oral account updating and it is not working, try going to the store support staff at http://www.apple.com/emea/support/itunes/contact.html for help.

  • How to format Memory card in N79 and 5630 Xpressmu...

    Hi everyone,
    I am using N79 amd 5630 Xpressmusic. Can any body tell me how to format the memory card in these sets. Coz in file manager there is no option to format memory card.
    Regards

    Hi Sappal,
    To format the memory card follow the below procedure:
    1. Go to "File Manager-> Memory Card" (I've named the memory card as N79).
    2. You will need to open the memory card and then go to its "Options" menu.
    3. Go to "Memory Card Options-> Format" and confirm.
    Please note that the memory card will not get formatted unless every application is closed and you have not installed any third party applications on it. For this, you will have to uninstall any third party applications and only then proceed with the memory card formatting procedure.
    Let me know if you need any assistance. My id is  
    Regards,
    Rahul
    moderator's note:
    removed personal contact information as it is inaappropriate to publish personal contact information on a public web forum.
    Rahul.Savaikar

  • Mail Not change state when BlackBerry are Power Off

    I have Groupwise with BlackBerry Server Version 4.1.4.28 and I have problems synchronizing the state of the mails read when the PDA's are turned off, summing up if a user reads a post on the Groupwise system in line with the PDA turned off, when you turn on your PDA mail marked as not read this, but everything else is working properly.
    We tried to force the synch but neither works.

    You aren't explicitly telling the program to repaint itself when you click the button. Otherwise, the only time paintComponent is called is when the object becomes visible, or when it's resized (and the system automatically tells it to repaint).
    I tried modifying your code a little and got it to work by passing the TrafficSubPanel as an argument in the constructor for ButtonListener, then stored that as a local variable in the ButtonListener class and when the actionPerformed method is called, just call myPanel.repaint().
    There might be other, more standardized ways of doing this though, I'm not sure.

  • Getting LR 5 to launch when card is inserted

    LR 5 does not launch automatically when a card is inserted on my Mac. Previous versions did so & the preference to do so is selected. Any thoughts?

    I have the same problem.  The only thing that launches automatically when my card reader is attached is the iPhoto ap!  I'm anxious to hear a solution for this as well!

  • How to get plain old S-video and Composite out from a MBP?

    Hi,
    this question is about someone's MacBook Pro he newly bought with adapters to get both DVI and Svideo/Composite Out.
    He got Mini DisplayPort to DVI-D converter, and a DVI-I to video converter, that cannot be plugged into a DVI-D port. Apple removed the analog capability of its adapter, that's bad. But what's badder is there doesn't seem to have any Mini DisplayPort to Svideo/Composite adapter, as there was with previous generation machines.
    How can someone easily output analog video from MBP?

    In fact, I recognize that these standards are old, which doesn't mean they're not up-to-date. Similar example, VGA connector is old, but perfectly useful, even in 2009. I recently plugged a 22" LCD with VGA and DVI on the same computer (a bland desktop PC), and there was strictly no difference. Same color depth, same crisp display. Even looking at a corner with a magnifier, nothing was different.
    So, changing standards just for the sake of it doesn't make any sense.
    Agreed that, as a pro, Apple would like me to buy their pro line, but nowhere in the pro line does an easy solution exists for S-Video and composite out. The solution you posted exists, but is unwieldly and not neat at all, if it doesn't break the Mac's connector under its weight. If a manufacturer can do this kind of adapter, Apple can do it better, and make a bigger profit out of it.
    For the adapter you posted, I don't ever buy anything that is not at least Mac+Windows compatible, or at a minimum is open-source, so anyone with programming skills can make something. The manufacturer also doesn't give a clue on how this works. I guess some sort of virtual driver sits in the system as a virtual IEEE1394 port so any program requiring FW can work transparently. Still, incompatible with the OS that most manufacturer ship their new PCs with, poor commercial decision, wether you like the OS or not.
    Adding FW in the MB unibody design wouldn't have cost anout $30. Rather, we're talking about a 25 cents chip, a 25 cents connector, which they would have rounded up to $20 and still, that was present in previous-gen MB. After all, they are indeed selling a matte screen on the MBP 17" for $50 more, despite them removing a single piece of glass which may cost, well, let's be fair, $5 to manufacture? That's dishonest. And capitalistically justified.
    So far, choosing a Mac for one's needs is no easy task: older white MacBooks have the same power as unibodies, excellent connectivity, top notch transfer speeds, BUT are heavier, as not as ecologically friendly nor do they have future-proof RAM standard. The unibodies are sleekier, easily recycled and will be able to be upgraded in the near future BUT is most likely unable to use current devices and have slower transfer speeds.
    For Pro models, the newer ones have great efficiency, much power and flexibility with their dual GPU BUT lost the option of matte screen, although their other pro-oriented monitors still default to matte. Only the 17" has the option. If a pro already finds his 15,4" bulky and with ample reserve power, will he buy the bigger and heavier 17"? Probably not.
    I understand that Apple way of doing business is keeping only what's essential with no unnecessary options (I'm looking at you, Asus, with you at least 10 different versions of you netbook). But this time, not everyone can find what he or she wants in Apple's line of laptops, as opposed to the iPod thing, where virtually any possible preference is covered.

  • Good afternoon all, I use my iPad 2 calendar like a diary and it is perfict as I travel globaly for work, how do I transfer the calendar notes and events out to use in reports etc?

    Good afternoon all
    I travel globaly for my work and use the iPad calendar as my diary and it is perfect as it has the times things are done how long was spent on each thing and notes regarding contents and outcomes of meetings.
    The down side is I cant just send this information to myself to cut and paste into reports etc. I have to read off my iPad and retype it into my report document.
    Is there a way arround this without changing to a diferent program as the calender is great apart form that.

    Why can you not copy from calendar and paste into report? Is the
    report being done on the iPad? If yes, what is the problem with cut
    and paste? If no, can you sync the calendar to the same computer/device
    as the report and then cut and paste there?
    What am I missing?

Maybe you are looking for