Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Reading a Smart Card using an Android App

JavaCard Applet Development Related Questions and Answers.
irvinmags
Posts: 11
Joined: Mon Apr 11, 2016 9:01 pm
Points :149
Contact:

Reading a Smart Card using an Android App

Post by irvinmags » 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:

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.

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Reading a Smart Card using an Android App

Post by UNKNwYSHSA » Wed May 04, 2016 3:43 am

1 Make sure your app is written follow the documentation: http://developer.android.com/guide/topi ... c/nfc.html
And there is one sample in the sdk: connectivity\CardReader
(You needs to obtain the permission to access NFC, register TECH_DISCOVERED action in AndroidManifest.xml and place your code in the action callback function.)
2 Debug your app and tell us which line your app crashed? and values of variables when crashing.
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 51 guests

JavaCard OS : Disclaimer