Reading a Smart Card using an Android App
Posted: Wed May 04, 2016 1:34 am
Hello guys, I am trying to develop and read a Smart Card using an Android app. So far my app crashes when I try to read the card.
Here's my code:
Question is, am doing the right thing to "speak with my card"? I am new to android development and I would also like to know if there's a library like smartcardIO that I could use to communicate with smart cards. Thanks.
Here's my code:
Code: Select all
Intent intent = getIntent();
byte[] getCAN = {(byte)0x90, (byte) 0xBD, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
IsoDep isoDep = IsoDep.get(tag);
try {
isoDep.connect();
isoDep.setTimeout(5000);
isoDep.transceive(getCAN); // now send your command
isoDep.close();
} catch (IOException e) {
e.printStackTrace();
}
Question is, am doing the right thing to "speak with my card"? I am new to android development and I would also like to know if there's a library like smartcardIO that I could use to communicate with smart cards. Thanks.