Code example for NfcManager

Methods: getDefaultAdapter

0
        return wm.isWifiEnabled();
    } 
 
    private boolean isNfcEnabled() { 
        NfcManager nm = (NfcManager) getActivity().getSystemService(Context.NFC_SERVICE);
        NfcAdapter na = nm.getDefaultAdapter();
        return (na != null) && na.isEnabled();
    } 
 
    private boolean isAndroidBeamEnabled() { 
        NfcManager nm = (NfcManager) getActivity().getSystemService(Context.NFC_SERVICE);
        NfcAdapter na = nm.getDefaultAdapter();
        return (na != null) && na.isNdefPushEnabled();
    } 
 
} 
Experience pair programming with AI  Get Codota for Java