Thursday, February 9, 2012

How to check whether NFC is enabled or not in android?


Below is the code to check........
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
NfcAdapter adapter = manager.getDefaultAdapter();
if (adapter != null && adapter.isEnabled()) {
          // adapter exists and is enabled.
}

No comments:

Post a Comment