Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Android NFC development

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to understand Android NFC development, in view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Near Field Communication (NFC) is a short-range wireless communication technology, which usually has an effective communication distance of less than 4 cm. The NFC operates at 13.65MHz and the communication rate ranges from 106 kbit/ seconds to 848kbit/ seconds.

NFC communication always consists of an initiator (initiator) and a recipient (target). Usually, initiator active transmission of electromagnetic field (RF) can provide power for passive receiver (passive target). The basic principle of its work is similar to that of radio. Precisely because the passive receiver can provide power through the initiator, target can have very simple forms, such as tags, cards, and sticker.

NFC also supports point-to-point communication (peer to peer) in which both parties involved in the communication have power support.

Compared with other wireless communication methods such as Bluetooth, NFC supports much smaller communication bandwidth and distance, but it has a low cost, such as the price tag may be only a few cents, and there is no need for pairing, searching equipment, etc., both sides of the communication can interact with each other as soon as they get close.

In Android NFC applications, Android mobile phones are usually used as the initiator of communication, that is, as the reader and writer of NFC. Android phones can also simulate as recipients of NFC communications and support P2P communications from Android 2.3.3 onwards.

Android's support for NFC is mainly in the android.nfc and android.nfc.tech packages.

The main classes in the android.nfc package are as follows:

NfcManager can be used to manage all the NFC Adapter indicated in Android devices, but since most Android devices support only one NFC Adapter, you can use getDefaultAapater directly to get the Adapter supported by the system.

NfcAdapter is a NFC Adapter object that can be used to define an Intent that allows the system to notify you of a defined NFC Tag when it detects Activity, and provides methods for registering forground tag messages to send, etc.

The data format defined by NdefMessage and NdefRecord NDEF for NFC forum.

Tag represents a passive Tag object, which can represent a label, card, key chain, etc. When the Android device detects a Tag, it creates a Tag object, places it in the Intent object, and sends it to the appropriate Activity.

Android.nfc.tech defines classes that can read and write to Tag. These classes can be divided into different classes according to the type of technology they use, such as NfcA, NfcB, NfcF, and MifareClassic.

This is the answer to the question about how to understand Android NFC development. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report