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

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

You cannot enable the NFC programmatically. The user has to do it manually through settings or hardware button.

Leave a Comment