79676741

Date: 2025-06-23 20:49:29
Score: 0.5
Natty:
Report link

Which MIFARE exactly? There are plenty of them. However, whatever MIFARE it is, I strongly recommend using TapLinx SDK. It is accessible from nxp.com if you make free account. That SDK also have quite good sample application. In short (and for MIFARE DESFire cards, but probably applicable to all smart cards from NXP using TapLinx SDK):

  1. Android app should use (defined in manifest) at least NFC permission:
<uses-permission android:name="android.permission.NFC" />
  1. Your app should listen to NFC actions:
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<action android:name="android.nfc.action.TAG_DISCOVERED" />
  1. In your activity that listens to NFC reading you should have an event handler, something like this:
protected void onNewIntent(@NonNull Intent intent) {
    YourCard card = CardController.cardLogic(intent, nxpNfcLibReference);
  1. Then, in cardLogic method:
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
byte[] uid = tag.getId();

Voila! But, as I said, register on NXP for free and search for TapLinx SDK for Android, and sample apps. There is also that SDK for Java. Sadly, no for DotNet.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Which
  • Low reputation (1):
Posted by: Slavek