has NFC Tech - Android Network

Android examples for Network:NFC

Description

has NFC Tech

Demo Code


//package com.java2s;
import android.nfc.Tag;
import android.nfc.tech.TagTechnology;

public class Main {
    static public boolean hasTech(Tag tag, String klassName) {
        for (String tech : tag.getTechList()) {
            if (tech.equals(klassName)) {
                return true;
            }//from  ww  w  . jav  a  2s.c o  m
        }
        return false;
    }

    static public boolean hasTech(Tag tag,
            Class<? extends TagTechnology> tech) {
        return hasTech(tag, tech.getCanonicalName());
    }
}

Related Tutorials