• 1-800-526-8630U.S. (TOLL FREE)
  • 1-917-300-0470EAST COAST U.S.
  • +353-1-416-8900REST OF WORLD
Professional NFC Application Development for Android - Product Image

Professional NFC Application Development for Android

  • ID: 2246159
  • April 2013
  • 308 Pages
  • John Wiley and Sons Ltd

A practical guide to developing and deploying Near Field Communication (NFC) applications

There has been little practical guidance available on NFC programming, until now. If you're a programmer or developer, get this unique and detailed book and start creating apps for this exciting technology. NFC enables contactless mobile communication between two NFC-compatible devices. It's what allows customers to pay for purchases by swiping their smartphones with Google Wallet, for example. This book shows you how to develop NFC applications for Android, for all NFC operating modes: reader/writer, peer-to-peer, and card emulation.

The book starts with the basics of NFC technology, an overview of the Android OS, and what you need to know about the SDK tools. It then walks you through all aspects of NFC app development, including SE programming. You'll find all you need to create an app, including functioning, downloadable code and a companion website with additional content. Valuable case studies help you understand each operating mode in clear, practical detail.
- Shows programmers and developers how to develop Near Field Communication (NFC) applications for Android, including Secure Element (SE) programming
- Expert authors are NFC researchers who have a deep knowledge of the subject
- Covers app development in all NFC operating modes: reader/writer, peer-to-peer, and card emulation
- Includes valuable case studies that showcase several system design and analysis methods, such as activity diagram, class diagram, UML, and others

Professional NFC Application Development for Android offers the clear, concise advice you need to create great applications for this emerging and exciting technology.

Note: Product cover images may vary from those shown

INTRODUCTION xix

CHAPTER 1: OVERVIEW OF NEAR FIELD COMMUNICATION 1

Ubiquitous Computing and NFC 2

Wireless Communication as NFC 3

RFID Technology 5

Essentials of an RFID System 6

Common RFID Applications 6

Smart Card Technology 7

Types of Smart Cards: Capability-Based Classification 7

SCOS 8

Types of Smart Cards: Mechanism-Based Classification 9

Common Smart Card Applications 10

NFC Technology 10

NFC Devices 13

NFC Operating Modes 14

NFC Applications 18

Summary 22

CHAPTER 2: NFC ESSENTIALS FOR APPLICATION DEVELOPERS 23

NFC Mobile 24

SE 25

NFC Interface 28

Interface Between SE and NFC Controller 29

HCI 31

Standards Used by NFC 32

Proximity Contactless Smart Card Standards 33

NFCIP 35

NFC Operating Mode Essentials 35

Reader/Writer Mode 36

Peer-to-Peer Mode 45

Card Emulation Mode 48

Standardization of NFC 49

Diversity of NFC Platforms 50

Summary 51

CHAPTER 3: GETTING STARTED WITH ANDROID 53

What Is Android? 54

Linux Kernel 55

Android Runtime 56

Libraries 56

Application Framework 56

Applications 56

Android SDK 56

What You Need to Start 56

JDK and JRE 57

Android SDK 57

Adding More Platforms and Other Components to the SDK 59

SDK Packages 62

Android API Levels 63

Structure of Android Applications 65

Android Application Components 65

Intents 66

Intent Filters 66

Manifest File 67

Application Requirements 68

Application Resources 69

Processes and Threads 69

Dalvik Virtual Machine (DVM) 71

Platform Tools 71

SDK Tools 72

Android Virtual Device 74

Summary 75

CHAPTER 4: ANDROID SOFTWARE DEVELOPMENT PRIMER 77

Creating Your First Android Application 78

Components of the Project 81

Running the Project 83

Running Applications on Your Mobile Phone 83

Running Applications Instantly 84

Running Applications by Manual Installation 84

Distributing Android Applications 85

1. Gathering Materials and Resources 85

2. Configuring the Application for Release 85

3. Compiling and Signing with Eclipse ADT 86

4. Publishing on Google Play 87

Understanding Hello World 87

Using Multiple Views 90

Android Project Resources 90

Alternative Resources 91

Accessing Resources 92

Using an Event Listener 92

Layout 92

Resources 94

Code 94

Using Relative Layout 95

Using Dialog Builders 97

Layout 98

Resources 98

Code 98

Using Grid Layout 100

Android Activity Lifecycle 102

Implementing Multiple Activities and Intents 104

Step 1: Creating the Layout File 105

Step 2: Building the ListView 105

Step 3: Implementing onItemClick 106

Step 4: Editing AndroidManifest.xml 106

Step 5: Creating a New Layout 107

Step 6: Creating a New Activity 108

Using Menu Items 108

Creating a Menu XML File 110

Layout 110

Code 111

Summary 112

CHAPTER 5: NFC PROGRAMMING: READER/WRITER MODE 115

NFC APIs in Android 116

android.nfc package 116

android.nfc.tech package 117

Tag Intent Dispatch System vs. Foreground Dispatch System 117

NFC Tag Intent Dispatch System 118

How NFC Tags Are Dispatched to Applications 118

How Android Handles NDEF-Formatted Tags 120

NFC Properties in the Android Manifest File 121

Filtering NFC Intents 122

ACTION_NDEF_DISCOVERED 122

ACTION_TECH_DISCOVERED 125

ACTION_TAG_DISCOVERED 127

Checking NFC Adapter 127

Tag Writing 128

Preparing NDEF Data 128

Writing NDEF Data to Tags 132

Tag Reading 135

Getting an NDEF Message 135

Processing an NDEF Message 136

Android Application Record 140

How It Works 140

Intent Filters vs. AAR 141

Important Notes on AAR 141

Using AAR 141

Foreground Dispatch System 141

Working with Supported Tag Technologies 143

Getting Available Tag Technologies 144

NfcV Example 145

Summary 147

CHAPTER 6: READER/WRITER MODE APPLICATIONS 149

NFC Smart Poster Use Case 150

Smart Poster Tag Writer Application 150

Smart Poster Reader Application 161

NFC Shopping Use Case 169

NFC Shopping Tag Writer Application 170

NFC Shopping Main Application 172

Student Transportation Tracking Use Case 175

Student Tracking Tag Writer Application 176

Student Tracking Main Application 177

Summary 179

CHAPTER 7: NFC PROGRAMMING: PEER-TO-PEER MODE 181

Performing Peer-to-Peer Transactions 182

Beaming NDEF Messages 183

Beaming with setNdefPushMessageCallback( ) 183

Beaming with setNdefPushMessage( ) 184

Common Notes 184

Receiving Beams 184

An Abstract Beam with setNdefPushMessageCallback( ) 185

An Abstract Beam with setNdefPushMessage( ) 186

Declaring Intent Filters 187

Using Android Application Records in Peer-to-Peer Mode 187

An Example Beam Application using setNdefPushMessageCallback( ) 187

An Example Beam Application using setNdefPushMessage( ) 191

Beam Support for API Level 10 196

Beaming with enableForegroundNdefPush( ) 196

An Example Beam Application Using enableForegroundNdefPush( ) 196

Android OS to Handle the Incoming Beam 199

Beaming Files 203

Beaming with setBeamPushUrisCallback( ) 203

Beaming with setBeamPushUris( ) 204

An Example Beam Application Using setBeamPushUrisCallback( ) 204

An Example Beam Application using setBeamPushUris( ) 204

Summary 205

CHAPTER 8: PEER-TO-PEER MODE APPLICATIONS 207

NFC Chatting 208

NFC Guess Number 215

NFC Panic Bomb 221

Summary 227

CHAPTER 9: NFC PROGRAMMING: CARD EMULATION MODE 229

Definition of Card Emulation Mode 230

Business Ecosystem 230

Stakeholders in an NFC Ecosystem 231

Business Models 232

Business Model Alternatives 232

General Revenue/Expenditure Flow Model 235

Card Emulation Mode Use Case Alternatives 236

Cashless Payment 236

Mobile Wallet 237

Ticketing 237

Loyalty Cards 237

Coupons 237

Card Emulation Mode Programming 238

Programming Secure Elements 238

Programming NFC Reader 240

Programming Android Applications 240

Enabling Android OS Access to SE 242

Setting up the Platform 243

Accessing SE 244

Summary 246

APPENDIX A: URI PREFIXES FOR NDEF 247

APPENDIX B: ANDROID NFC PACKAGES 249

INDEX 265

Note: Product cover images may vary from those shown

Vedat Coskun established NFC Lab - Istanbul (NFCLab.com), the leading research lab on Near Field Communication technology worldwide. His major research areas are NFC, mobility, mobile application development, cashless payment, smartcards, Java technology, and mobile security.

Kerem Ok and Busra Ozdenizci are researchers at NFC Lab - Istanbul who have participated in several groundbreaking NFC technology projects.

Professional NFC Application Development for Android offers the step-by-step guidance, expert advice, and insider tips you need to hop on the NFC bandwagon and start creating brilliant NFC apps for Android devices in no time.

Note: Product cover images may vary from those shown
Note: Product cover images may vary from those shown

RELATED PRODUCTS

Our Clients

Our clients' logos