Introduction to Android NFC development practices + source code
SkySeraph Mar. 14th 2014
Email: skyseraph00@163.com
ABOUT
Haha, my first book is about to be published. (It was supposed to be published at the beginning of this year. Like Ma Hang, it was inexplicably dragged on to the present. According to the latest news from the press, it is expected to be officially published in mid-to-late March, so stay tuned). The cover is as follows. Thank you, Mr. Zhang Tao of the people's post and telecommunications for your contribution to this book ,...... this book was written around March last year. The book is divided into three parts: basic, application, and example (for details, see the MENU below )...
LINK: To do
NFC-related QQ Group:
NFC Technology Alliance221282715
NFC product Alliance221281036
MENU
Article 1 Basics
Chapter 4 NFC Overview
1.1 RFID basics... 2
1.1.1 introduction to RFID... 2
1.1.2 composition and working principle of the RFID system... 3
1.1.3 RFID application overview... 6
1.2 NFC basics... 7
1.2.1 NFC introduction... 7
1.2.2 technical comparison... 8
1.2.3 NFC device... 11
1.2.4 NFC communication mode... 11
1.2.5 NFC working mode and application classification... 13
1.3 Working Principle of NFC... 15
1.4 NFC application instance... 16
1.4.1 NFC ecosystem... 16
1.4.2 NFC application instance... 17
1.5 NFC development of common network resources... 19
1.6 Summary of this chapter... 20
Chapter 4 NFC protocol Basics
2.1 NFC technical standards... 21
2.2 NFC Standard Specification... 24
2.2.1 ISO 14443. 24
2.2.2 NFCIP-1. 25
2.2.3 MIFARE. 26
2.2.4 FeliCa. 26
2.3 nfc tag .. 27
2.3.1 Tag type defined by NFC Forum... 27
2.3.2 NXP-specific Tag type... 29
2.4 NDEF protocol... 29
2.4.1 NDEF overview... 30
2.4.2 NDEF instance... 33
2.5 RTD protocol... 34
2.5.1 RTD_TEXT... 34
2.5.2 RTD_URI 35
2.5.3 RTD_Smart Poster 36
2.6 LLCP protocol... 37
2.7 NFC Protocol Summary... 39
2.8 summary of this chapter... 40
Chapter 4 Android basics in NFC development... 41
3.1 Android overview... 41
3.1.1 basic concepts of Android... 41
3.1.2 Android development... 42
3.1.3 Android development environment... 42
3.2 Android Application structure... 44
3.3 Android system architecture... 45
3.4 basic Android knowledge in NFC development... 47
3.4.1 Activity lifecycle... 47
3.4.2 Intent-Filter 48
3.5 NFC development in Android TV... 50
3.5.1 integrate NFC hardware with Android TV +... 50
3.5.2 integrate NFC Tag. 51 with Android TV +
3.5.3 integrate nfc rc with Android TV +... 52
3.5.4 Android TV + integrated NFC RC + integrated NFC hardware... 53
3.6 summary of this chapter... 54
Article 2 Application/Technology
Chapter 4 Android nfc api overview... 56
4.1 nfc api 56 in Android
4.1.1 android. nfc package... 56
4.1.2 android. nfc. tech package... 59
4.1.3 nfc api use Step 1: NFC settings in Android Manifest... 59
4.1.4 nfc api Step 2: Obtain NfcAdapter... 60
4.2 NFC tag scheduling system... 62
4.2.1 NFC foreground scheduling system... 62
4.2.2 NFC tag scheduling system... 63
4.2.3 NFC tag ing... 64
4.2.4 how the application schedules NFC tags... 65
4.3 NFC Intent filter... 66
4.3.1 ACTION_NDEF_DISCOVERED... 66
4.3.2 ACTION_TECH_DISCOVERED... 70
4.3.3 ACTION_TAG_DISCOVERED... 71
4.4 Android Application records... 72
4.4.1 AAR basics... 72
4.4.2 differences between AAR and Intent filters... 72
4.4.3 use of AAR in Android... 73
4.5 Android nfc api and System Version table... 73
4.6 Summary of this chapter... 74
Chapter 1 NFC read/write mode development... 79
5.1 about NFC read/write mode... 79
5.2 TAG read operation (NDEF data)... 79
5.2.1 TAG read operation procedure... 80
5.2.2 TAG read operation instance... 86
5.3 TAG write operation (NDEF data)... 98
5.3.1 TAG write procedure... 98
5.3.2 TAG write operation instance... 108
5.4 TAG read/write operations based on AAR... 121
5.5 non-NDEF data TAG read operation... 121
5.6 summary of this chapter... 123
Chapter 4 NFC P2P model development... 6th
6.1 about NFC P2P mode... 124
6.1.1 conditions for Beam use... 124
6.1.2 Determination of Beam Enable... 125
6.2 Android NFC P2P development basics... 126
6.2.1 several methods implemented by Android Beam... 127
6.2.2 Beam NDEF message (BNM)... 129
6.2.3 receive Beam messages (RBM)... 130
6.2.4 use of enableForegroundNdefPush... 130
6.3 Android NFC P2P development instance... 132
6.3.1 instance 1: Use setNdefPushMessageCallback to implement Android Beam .. 132
6.3.2 instance 2: Use setNdefPushMessage to implement Android Beam... 143
6.3.3 instance 3: Use enableForegroundNdefPush to implement Android Beam .. 151
6.3.4 instance 4: Android Beam .. 157 With AAR
6.4 Android NFC P2P development advanced... 162
6.4.1 Beam Method for file transfer... 162
6.4.2 Beam File Transfer instance 1: setBeamPushUris. 164
6.4.3 Beam File Transfer instance 2: setBeamPushUrisCallback. 169
6.5 section of this chapter... 172
Chapter 4 Development of NFC card simulation model... 7th
7.1 NFC card analog mode... 173
7.2 hardware-based card simulation-virtual card mode... 174
7.2.1 overview of virtual card mode... 174
7.2.2 Security Unit SE and SWP. 174
7.2.3 development of the virtual card model... 177
7.3 software-based card simulation-host card mode... 183
7.3.1 Overview of host card mode... 183
7.3.2 advantages of host card mode... 184
7.3.3 hidden danger of host card mode... 185
7.3.4 Development of Host card mode... 187
Prospect of 7.4 card simulation mode... 187
7.5 summary of this chapter... 188
Article 3 Examples
Chapter 4 NFC instance 1-WiFi quick connection assistant... 8th
8.1 development background and function overview... 190
8.1.1 development background... 190
8.1.2 function overview... 190
8.1.3 development environment and target platform... 191
8.2 software preview and function structure... 191
8.2.1 software preview... 191
8.2.2 function structure... 194
8.3 Main Interface Design... 195
8.3.1 WiFi information configuration page... 195
8.3.2 WiFi configuration information TAG writing interface... 197
8.3.3 AndroidManifest. Xml file... 198
8.4 main program implementation... 199
8.4.1 WiFi configuration information input module... 199
8.4.2 WiFi configuration information TAG Writing module... 203
8.4.3 TAG WiFi information reading module... 207
8.4.4 WiFi automatic connection module... 211
8.4.5 UI auxiliary module... 214
8.5 summary of this chapter... 215
Chapter 2 NFC instance 2 -- EasyTagWrite... 9th
9.1 Development background and function overview... 216
9.1.1 development background... 216
9.1.2 function overview... 216
9.1.3 development environment and target platform... 217
9.2 software preview and function structure... 217
9.2.1 software preview... 217
9.2.2 function structure... 220
9.3 Main Interface Design... 220
9.4 main program implementation... 223
9.4.1 UI Interaction module... 223
9.4.2 NDEF message generation module... 228
9.4.3 NDEF message Writing module... 231
9.5 summary of this chapter... 231
Chapter 3 NFC instance 3-NFCard... 10th
10.1 NFCard overview... 232
10.1.1 introduction... 232
10.1.2 environment platform... 232
10.2 software preview and function structure... 233
10.2.1 software preview... 233
10.2.2 function structure... 234
10.3 main interface parsing... 235
10.4 main program parsing... 238
10.4.1 UI Interaction module... 239
10.4.2 Card reading module... 244
10.4.3 Card resolution module... 247
10.5 summary of this chapter... 249
Appendix abbreviations and acronyms 250
CODE
Examples in the Book source code: https://github.com/skyseraph/android_nfc_book
==========
By SkySeraph-2014
SYNC SkySeraph cnBlogs