9 Ekim 2018 Salı

NfcAdapter Sınıfı

Giriş
Açıklaması şöyle.
Contactless smart cards
A second card type is the contactless smart card, in which the card communicates with and is powered by the reader through RF induction technology (at data rates of 106–848 kbit/s). These cards require only proximity to an antenna to communicate. Like smart cards with contacts, contactless cards do not have an internal power source. Instead, they use an inductor to capture some of the incident radio-frequency interrogation signal, rectify it, and use it to power the card's electronics.
constructor
Şöyle yaparız.
NfcManager manager = ...;
NfcAdapter adapter = manager.getDefaultAdapter();
getDefaultAdaptet metodu
Şöyle yaparız.
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(MainActivity.this);
isEnabled metodu
Şöyle yaparız.
if (adapter != null && adapter.isEnabled()) {
    // adapter exists and is enabled.
}

Hiç yorum yok:

Yorum Gönder