This content has been marked as final. Show 2 replies
1) Import android.smartcard libraries,
2) Try to make a connection :
3) create an instance of smartcardclient:
ISmartcardConnectionListener connectionListener = new ISmartcardConnectionListener()
4) get the list of readers :
smartcard = new SmartcardClient(this, connectionListener);
you can check if a specific reader is connected or nor with
String readers = smartcard.getReaders();
5) create a card channel and select your applet:
6) you can send and receive APDUs with this line of code:
cardChannel = smartcard.openLogicalChannel(cardReader, APPLET_AID); ICardChannel cardChannel = null; cardChannel = smartcard.openLogicalChannel(cardReader, APPLET_AID);
byte response Apdu = cardChannel.transmit(commandApdu);
If you have access to the Android build (using AOSP) then you might also be able to use the nfc_extras.jar which provides and API for sending APDUs to the secure element in a device. There is also SEEK for Android that you might be able to use.
As you can image though, access to the secure element is usually locked down (for security reasons) so you may need access to the Android build for this to work (or have a rooted phone).