[android-developers] Re: android nfc tech API help
When using the NfcB transceive I get an exception: Connecting to this technology is not supported by the NFC adapter. Does this means that my Nexus S (4.1.1) can't talk with NfcB tags beyond the ATQB? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
Still can you tell me how can I read the data after I figure out the type of card and all the information you mentioned?? And thanks for replying..:) On Jul 10, 12:50 am, Michael Roland mi.rol...@gmail.com wrote: Hallo Sumit, Can you please tell me how can read data from this type of card? Also, is there any way to find the type of card from coding? Well, that depends on what type of card you have. Knowing that the card is ISO 14443 Type B is certainly not enough to figure out how this card's data can be accessed. You definitely need to know further details of the card (e.g. does it support NDEF?, does it support IsoDep?, what memory structures are used? what communication protocols are used? what chip does it contain? ...) As Dominik pointed out, a starting point is the tags tech-list. br, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
Hallo Sumit, Can you please tell me how can read data from this type of card? Also, is there any way to find the type of card from coding? Well, that depends on what type of card you have. Knowing that the card is ISO 14443 Type B is certainly not enough to figure out how this card's data can be accessed. You definitely need to know further details of the card (e.g. does it support NDEF?, does it support IsoDep?, what memory structures are used? what communication protocols are used? what chip does it contain? ...) As Dominik pointed out, a starting point is the tags tech-list. br, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
Also, is there any way to find the type of card from coding? The type of a tag, that is its supported technologies can be accessed with method getTechList on a Tag instance. Dominik -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
Michael Roland mi.roland at gmail.com writes: Hello Micheal, I am trying to read data from a NfcB card but I get NoClassDefFound exception if I try to get an object of NfcB using: NfcB myTag = NfcB.get(t) Can you please tell me how can read data from this type of card? Also, is there any way to find the type of card from coding? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: android nfc tech API help
From android point of view it doesnt matter what the command data is, its all byte[] to the transcieve. I try to get a isodep first. if that fails i try to get a NfcB tag. In my cardB case, I tried to connect * transcieve using ISODep and get back 6700 If I try to get a NfcB tag, the connect fails with exception. On Tue, May 3, 2011 at 11:10 PM, Michael Roland mi.rol...@gmail.com wrote: Hallo, which variant did you use, the low-level access or the IsoDep acccess? The low-level example will only work with MIFARE Ultralight cards (these are always NfcA). Sorry, I don't know any example for low-level access to NfcB cards. The IsoDep example will certainly only give a useful result if the card contains the ICAO electronic passport application... br Michael On 30.04.2011 00:58 priti - wrote: Hi Michael, Thanks! that worked with my nfcA cards! But when I use it with my nfcB cards, I am getting a 67 00 (protocol error?) Appreciate your help, Priti On Thu, Apr 28, 2011 at 8:50 AM, Michael Roland mi.rol...@gmail.com mailto:mi.rol...@gmail.com wrote: Hallo, What exactly is low level access? With low-level access (as compared to APDU based access) I mean some vendor specific (proprietary) protocol according to the ISO/IEC 14443-3 standard. Thus, instead of sending high-level APDU commands a more simple protocol is used (such a protocol is for example the MIFARE Ultralight and the MIFARE Classic command-set). How do I send/receive nfcA/nfcB commands then? For NfcA (e.g. MIFARE Ultralight) you would simply retrieve an NfcA object: NfcA myTag = NfcA.getTag(tag); And then transceive low-level commands with transceive() method. E.g. byte[] data = myTag.transceive(new byte[]{ (byte)0x30, (byte)0x00 }); would retrieve the first 16 bytes of data from an MIFARE Ultralight tag. But as you suggested you want to transfer APDUs, instead of getting an NfcA object you would want to get an IsoDep object for the tag. This object wraps an APDU-based (ISO/IEC 14443-4 ISO/IEC 7816-4) connection: IsoDep myCard = IsoDep.getTag(tag); The transceive() method then allows you to directly transmit command APDUs to the contactless smart card and returns the response APDU: byte[] response = myCard.transceive(command); Where command could be, for instance, a SELECT(file by DF name) command. The following command would select the ICAO electronic passport application (AID A002471001): byte[] command = new byte[]{ (byte)0x00, /* CLA = 00 (first interindustry command set) */ (byte)0xA4, /* INS = A4 (SELECT) */ (byte)0x04, /* P1 = 04 (select file by DF name) */ (byte)0x0C, /* P2 = 0C (first or only file; no FCI) */ (byte)0x07, /* Lc = 7 (data/AID has 7 bytes) */ /* AID = A002471001: */ (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x47, (byte)0x10, (byte)0x01 }; As a response you would get e.g. status code 9000 if the applet was found on the card. Best regards, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: android nfc tech API help
Hallo, which variant did you use, the low-level access or the IsoDep acccess? The low-level example will only work with MIFARE Ultralight cards (these are always NfcA). Sorry, I don't know any example for low-level access to NfcB cards. The IsoDep example will certainly only give a useful result if the card contains the ICAO electronic passport application... br Michael On 30.04.2011 00:58 priti - wrote: Hi Michael, Thanks! that worked with my nfcA cards! But when I use it with my nfcB cards, I am getting a 67 00 (protocol error?) Appreciate your help, Priti On Thu, Apr 28, 2011 at 8:50 AM, Michael Roland mi.rol...@gmail.com mailto:mi.rol...@gmail.com wrote: Hallo, What exactly is low level access? With low-level access (as compared to APDU based access) I mean some vendor specific (proprietary) protocol according to the ISO/IEC 14443-3 standard. Thus, instead of sending high-level APDU commands a more simple protocol is used (such a protocol is for example the MIFARE Ultralight and the MIFARE Classic command-set). How do I send/receive nfcA/nfcB commands then? For NfcA (e.g. MIFARE Ultralight) you would simply retrieve an NfcA object: NfcA myTag = NfcA.getTag(tag); And then transceive low-level commands with transceive() method. E.g. byte[] data = myTag.transceive(new byte[]{ (byte)0x30, (byte)0x00 }); would retrieve the first 16 bytes of data from an MIFARE Ultralight tag. But as you suggested you want to transfer APDUs, instead of getting an NfcA object you would want to get an IsoDep object for the tag. This object wraps an APDU-based (ISO/IEC 14443-4 ISO/IEC 7816-4) connection: IsoDep myCard = IsoDep.getTag(tag); The transceive() method then allows you to directly transmit command APDUs to the contactless smart card and returns the response APDU: byte[] response = myCard.transceive(command); Where command could be, for instance, a SELECT(file by DF name) command. The following command would select the ICAO electronic passport application (AID A002471001): byte[] command = new byte[]{ (byte)0x00, /* CLA = 00 (first interindustry command set) */ (byte)0xA4, /* INS = A4 (SELECT) */ (byte)0x04, /* P1 = 04 (select file by DF name) */ (byte)0x0C, /* P2 = 0C (first or only file; no FCI) */ (byte)0x07, /* Lc = 7 (data/AID has 7 bytes) */ /* AID = A002471001: */ (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x47, (byte)0x10, (byte)0x01 }; As a response you would get e.g. status code 9000 if the applet was found on the card. Best regards, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: android nfc tech API help
Hi Michael, Thanks! that worked with my nfcA cards! But when I use it with my nfcB cards, I am getting a 67 00 (protocol error?) Appreciate your help, Priti On Thu, Apr 28, 2011 at 8:50 AM, Michael Roland mi.rol...@gmail.com wrote: Hallo, What exactly is low level access? With low-level access (as compared to APDU based access) I mean some vendor specific (proprietary) protocol according to the ISO/IEC 14443-3 standard. Thus, instead of sending high-level APDU commands a more simple protocol is used (such a protocol is for example the MIFARE Ultralight and the MIFARE Classic command-set). How do I send/receive nfcA/nfcB commands then? For NfcA (e.g. MIFARE Ultralight) you would simply retrieve an NfcA object: NfcA myTag = NfcA.getTag(tag); And then transceive low-level commands with transceive() method. E.g. byte[] data = myTag.transceive(new byte[]{ (byte)0x30, (byte)0x00 }); would retrieve the first 16 bytes of data from an MIFARE Ultralight tag. But as you suggested you want to transfer APDUs, instead of getting an NfcA object you would want to get an IsoDep object for the tag. This object wraps an APDU-based (ISO/IEC 14443-4 ISO/IEC 7816-4) connection: IsoDep myCard = IsoDep.getTag(tag); The transceive() method then allows you to directly transmit command APDUs to the contactless smart card and returns the response APDU: byte[] response = myCard.transceive(command); Where command could be, for instance, a SELECT(file by DF name) command. The following command would select the ICAO electronic passport application (AID A002471001): byte[] command = new byte[]{ (byte)0x00, /* CLA = 00 (first interindustry command set) */ (byte)0xA4, /* INS = A4 (SELECT) */ (byte)0x04, /* P1 = 04 (select file by DF name) */ (byte)0x0C, /* P2 = 0C (first or only file; no FCI) */ (byte)0x07, /* Lc = 7 (data/AID has 7 bytes) */ /* AID = A002471001: */ (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x47, (byte)0x10, (byte)0x01 }; As a response you would get e.g. status code 9000 if the applet was found on the card. Best regards, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: android nfc tech API help
Hallo, What exactly is low level access? With low-level access (as compared to APDU based access) I mean some vendor specific (proprietary) protocol according to the ISO/IEC 14443-3 standard. Thus, instead of sending high-level APDU commands a more simple protocol is used (such a protocol is for example the MIFARE Ultralight and the MIFARE Classic command-set). How do I send/receive nfcA/nfcB commands then? For NfcA (e.g. MIFARE Ultralight) you would simply retrieve an NfcA object: NfcA myTag = NfcA.getTag(tag); And then transceive low-level commands with transceive() method. E.g. byte[] data = myTag.transceive(new byte[]{ (byte)0x30, (byte)0x00 }); would retrieve the first 16 bytes of data from an MIFARE Ultralight tag. But as you suggested you want to transfer APDUs, instead of getting an NfcA object you would want to get an IsoDep object for the tag. This object wraps an APDU-based (ISO/IEC 14443-4 ISO/IEC 7816-4) connection: IsoDep myCard = IsoDep.getTag(tag); The transceive() method then allows you to directly transmit command APDUs to the contactless smart card and returns the response APDU: byte[] response = myCard.transceive(command); Where command could be, for instance, a SELECT(file by DF name) command. The following command would select the ICAO electronic passport application (AID A002471001): byte[] command = new byte[]{ (byte)0x00, /* CLA = 00 (first interindustry command set) */ (byte)0xA4, /* INS = A4 (SELECT) */ (byte)0x04, /* P1 = 04 (select file by DF name) */ (byte)0x0C, /* P2 = 0C (first or only file; no FCI) */ (byte)0x07, /* Lc = 7 (data/AID has 7 bytes) */ /* AID = A002471001: */ (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x47, (byte)0x10, (byte)0x01 }; As a response you would get e.g. status code 9000 if the applet was found on the card. Best regards, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
What exactly is low level access? How do I send/receive nfcA/nfcB commands then? Am confused! On Apr 9, 2:57 am, Michael Roland mi.rol...@gmail.com wrote: Hallo Priti, I can get aNfcAobject using the getTag(tag) method. NfcAmyTag =NfcA.getTag(tag); I then do a [...] retData = myTag.transcieve(apduCmd); //where apduCmd has a Select AID cmd} Right, you are supposed to get an exception with this. TheNfcAtech is for low-level access to ISO 14443 Type A tags (i.e. the proprietary protocol as mentioned in ISO 14443-3.) Exchanging APDUs happens on top of ISO 14443-4 data exchange protocol (which is independend of whether you use type A or B by the way). The correct tech for this is IsoDep. br Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android nfc tech API help
Hallo Priti, I can get a NfcA object using the getTag(tag) method. NfcA myTag = NfcA.getTag(tag); I then do a [...] retData = myTag.transcieve(apduCmd); //where apduCmd has a Select AID cmd} Right, you are supposed to get an exception with this. The NfcA tech is for low-level access to ISO 14443 Type A tags (i.e. the proprietary protocol as mentioned in ISO 14443-3.) Exchanging APDUs happens on top of ISO 14443-4 data exchange protocol (which is independend of whether you use type A or B by the way). The correct tech for this is IsoDep. br Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en