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):
<uses-permission android:name="android.permission.NFC" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<action android:name="android.nfc.action.TAG_DISCOVERED" />
protected void onNewIntent(@NonNull Intent intent) {
YourCard card = CardController.cardLogic(intent, nxpNfcLibReference);
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.