Android Studio - Complete Android Apps Tutorial – Near Field Communications NFC- Day 31 - 10.16
Автор: Rain Forest -热带雨林(RF)
Загружено: 2016-04-22
Просмотров: 2563
Near Field Communications NFC
2
Near Field Communications - NFC A short-range high frequency 13.56MHz wireless communication technology that enables the exchange of data between devices over about 10cm distance.
3
NFC Tags ● Mifare Classic 1K 752 bytes, 4K 3440 bytes ● Low cost and very common TnG etc. ● Not NFC forum compliant and therefore not compatible with most latest Android phones ● NFC Forum Type 2 Tag ● NFC forum compliant tag and therefore compatible with all Android phones with NFC capability ● Mifare Ultralight 46 bytes ● NTAG203/NTAG213 142 bytes
4
NFC Data Exchange Format NDEF •NFC data usually encoded in NDEF format •A lightweight, binary message format that can be used to encapsulate one or more application-defined payloads of arbitrary type and size •Each NDEF message consists of one or more NDEF records
5
Writing Data to NFC Tags Using the Android App NFC TagWriter by NXP downloaded from https://play.google.com/store/apps/de... c.tagwriter
6
Writing Data to NFC Tags
7
Writing Data to NFC Tags
8
Writing Data to NFC Tags
9
Android NFC Modes •Reader Mode •read NFC tags since API Level 9 •write NFC tags since API Level 10 •P2P Mode •2 devices exchange data since API Level 10 •Card Emulation • Host-based Card Emulation since API Level 19
10
NFC Adapter •Represents the local NFC adapter •Using NFC requires permission in Android Manifest “android.permission.NFC” •Get the default NFC adapter for an Android device with
NfcAdapter nfc = NfcAdapter.getDefaultAdapterthis;
•getDefaultAdapter returns null if NFC is not supported •nfc.isEnabled returns false if NFC is not enabled
11
Android NFC Tag Dispatch System
12
Android NFC Tag Dispatch System •NFC Foreground Dispatch •The Activity will read NDEF data when it is active in the foreground •Enable by calling enableForegroundDispatch •NFC Background Dispatch •The Activity will read NDEF data even when Activity is not yet launched or running in the background •Enable by adding an Intent Filter in Android Manifest
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: