|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Who This Book Is For 2
Recommended Reading 2
What’s Covered in This Book 3
What You’ll Need 4
Hardware 4
Software 6
Other Useful NFC Apps 7
Conventions Used in This Book 7
Using Code Examples 8
Safari® Books Online 8
How to Contact Us 9
Acknowledgments 9
2. NFC and RFID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
What’s RFID? 11
What’s NFC? 12
How RFID Operates 13
RFID Standards 13
How NFC Operates 14
NFC Data Exchange Format (NDEF) 14
The Architecture of NFC 15
NFC Tag Types 17
Where to Get Tags 18
Device-to-Tag Type Matching 19
What You Can Do with NFC 20
Conclusion 21
3. Getting Started with PhoneGap and the PhoneGap-NFC Library. . . . . . . . . . . . . . . . . . . 23
Why Android? 23
Hello, World! Your First PhoneGap App 24
Setting Up the Development Environment 24
Creating a PhoneGap Project 29
The Important Files 33
A Simple Locator App 34
PhoneGap Meets NFC: NFC Reader 40
Installing the NFC Plug-In 41
Writing the NFC Reader App 42
Troubleshooting 46
Conclusion 46
4. Introducing NDEF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
NDEF Structure 49
Type Name Format 51
Payload Type 51
Payload Identifier 53
Payload 53
Record Layout 53
Record Header 54
How Big Can an NDEF Message Be? 55
Record Chunking 56
Additional Info 56
NDEF in Practice 56
A Tag Writer Application: Foursquare Check-In 61
Writing an NDEF Record to a Tag 62
Writing Different Record Types 66
PhoneGap-NFC NDEF Helper Functions, Summarized 71
Conclusion 72
5. Listening for NDEF Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
PhoneGap-NFC’s Event Listeners 75
An NDEF Reader Application 77
Listening for Multiple Events 78
Reading the NDEF Messages 81
Filtering Tags Using Record Types 84
Filtering Using MIME-Types 86
Android’s Tag Dispatch System 89
Types of Intents 89
Android Application Records 93
…………………………
Beginning NFC.part1.rar
(14 MB, 下载次数: 603 )
Beginning NFC.part2.rar
(12.14 MB, 下载次数: 587 )
|
|