I'm currently working with an Android payment application which can communicate with ISO/IEC 14443-4 Smart Card using NFC.
To that purpose in my Activity I have enabled reader mode using
mNfcAdapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_B | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK, null);
and overidded ReaderCallback
's onTagDiscovered()
method to send and receive APDU commands between Android application and ISO/IEC 14443-4 Smart Card .
Since ReaderCallback and override onTagDiscovered()
is available from API level 19 (KitKat),It's working fine with Android devices running on KitKat.
I would like to make my application work with Android ICS and Jelly Bean as well. Is there any alternative way or work around for this enable Reader Mode, to do APDU communication for ICS and JellyBean..?
No, there is no direct equvalent to enableReaderMode (in the way you are using it) before Android 4.4. However, you can achieve similar functionality by using the foreground dispatch system (see this answer on how to use the foreground dispatch).
Nevertheless, note that there are some differences between using enableReaderMode(... FLAG_READER_NFC_B ... FLAG_READER_SKIP_NDEF_CHECK ...)
and using enableForegroundDispatch(...)
: