public boolean checkNFCHardware() {
NfcManager nfcManager = (NfcManager) getSystemService(Context.NFC_SERVICE);
NfcAdapter nfcAdapter = nfcManager.getDefaultAdapter();
if (nfcAdapter == null) {
// Device not compatible for NFC support return false;
} else if (!nfcAdapter.isEnabled()) {
// If NFC not enabled, application can request Settings UI allowing the user to toggle/enable NFC from startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
return false;
} else {
return true;
}
}
Comments
Post a Comment