has NFC Support - Android Network

Android examples for Network:NFC

Description

has NFC Support

Demo Code


//package com.java2s;
import android.content.Context;

import android.nfc.NfcAdapter;

public class Main {
    /**/* ww w.  j a  va 2  s . c  o m*/
     * @return true if this device has NfcAdapter support this means it supports NFC technology,
     * otherwise return false.
     */
    public static boolean hasNFCSupport(Context context) {
        boolean result = true;
        NfcAdapter myNfcAdapter = NfcAdapter.getDefaultAdapter(context);
        if (myNfcAdapter == null) {
            result = false;
        }
        return result;
    }
}

Related Tutorials