This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
// 5.1) Connect to card | |
mfc.connect(); | |
boolean auth = false; | |
String cardData = null; | |
// 5.2) and get the number of sectors this card has..and loop | |
// thru these sectors | |
int secCount = mfc.getSectorCount(); | |
int bCount = 0; | |
int bIndex = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void resolveIntent(Intent intent) { | |
// 1) Parse the intent and get the action that triggered this intent | |
String action = intent.getAction(); | |
// 2) Check if it was triggered by a tag discovered interruption. | |
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)) { | |
// 3) Get an instance of the TAG from the NfcAdapter | |
Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); | |
// 4) Get an instance of the Mifare ultralight card from this TAG | |
// intent | |
MifareUltralight mfc = MifareUltralight.get(tagFromIntent); |