2. NFC - Intro
NFC (Near Field Communication) is a form of
short range (a few cms) wireless comm.
Powered through modulated magnetic field
Google Confidential and Proprietary
3. NFC - Intro
NFC Smart Cards can have functional applets
(Java Card)
Capable of storage, reading, crypto, etc.
Google Confidential and Proprietary
4. NFC - Intro
Throughput is low, but useful for transferring
URLs or small chunks of data (106-424 kbit/s)
Action is very specific, the short range makes
the intent clear
Google Confidential and Proprietary
5. NFC - Smart Phones
With smart phones the next logical step was to
move the NFC hardware inside
Google Confidential and Proprietary
6. NFC - Secure Element?
Basically is equivalent to taking the hardware
in a NFC card and putting it in your phone.
Hardware component with built in “applets”
and resilient tamper-proofing.
Two types UICC (SIM card) and eSE (NFC
controller)
Google Confidential and Proprietary
8. Secure Element - Tradeoffs
Payment applets on the SE contain sensitive
data and require increased security
Limited space on the SE
Ownership of Secure Element is contentious
Solution: Restrict access to the SE. There are
no public Android APIs to access SE
Google Confidential and Proprietary
9. What is Host Card Emulation?
HCE allows Android to emulate a NFC smart
card without requiring a secure element
This enables innovation for many new use
cases such as building access, mass transit
and loyalty
Works alongside other card emulation modes
on secure element based solutions
Google Confidential and Proprietary
12. HCE Development - Two Stages
App selection: Which app should be selected
when you tap your phone to a reader?
Data transfer: How do you actually send and
receive data to and from the NFC reader?
Google Confidential and Proprietary
13. HCE - App Selection
App 1 App 2 App 3
Google Confidential and Proprietary
?
NFC Reader
14. HCE - AID Registration
F506
App 1 App 2 App 3
Google Confidential and Proprietary
NFC Reader
AID: F506
F123
F932
F999 F007
15. AID Querying
NFC
Reader
Google Confidential and Proprietary
App X
AID: F56
Select AID “F12”
Android
OS
“Not found”
Lookup, app
not found
Lookup, resolve to app X
Select AID “F56”
Select AID “F56”
OK + Response Data
Command
Response
16. Conflict resolution - AID Categories
If conflict, then
automatically choose
“Default” app
Google Confidential and Proprietary
AID Categories
App X App Y
AID F123
AID F078
AID F123
AID F234
Default
Select AID
F123
17. Conflict resolution - AID Categories
If no “Default”, then ask
user
Google Confidential and Proprietary
Complete action with:
App X
App Y
Select AID
F123
18. Conflict resolution - AID Categories
Two AID Categories: Payments & Other
Payments category has a system UX so users
can choose their default wallet app.
With a default wallet app, users can pay with
one tap rather than selecting wallet at payment
time
Google Confidential and Proprietary
19. Payments!
An example of how AID selection works at
payment terminals
Consumers can have multiple wallet/loyalty
apps, and multiple cards within each app.
How does AID selection work in this case?
Google Confidential and Proprietary
20. Payments -- Naïve AID Selection
NFC
Reader
Select MasterCard AID
Select Discover AID
Select AmEx AID
Google Confidential and Proprietary
Wallet X
AID: F56
Select Visa AID
Android
OS
Not Found
Lookup, resolve to
Wallet X
Select AID “F56”
Not Found
Not Found
Not Found
21. Payments -- The Fast Method (EMV)
NFC
Reader
Google Confidential and Proprietary
Wallet X
AID: F56
Android
OS
What Payment
AIDs do you have?
I have “F56”, “F12”
Lookup, resolve
to app X
Select F56
Select AID “F56”
Wallet A
AID: F12
22. AID Selection - Review
Apps register one or many AIDs in manifest.
Readers select apps by querying with AIDs.
Conflicts either resolved automatically
(payments) or by user
Google Confidential and Proprietary
23. Sending + Receiving Data
Use a Service that is always listening for NFC.
Two modes: you can indicate if you need the
screen to be unlocked or not. Locked mode
can overlay UI on lock screen.
For example with a wallet app, you might want
the phone to be unlocked for security.
Google Confidential and Proprietary
24. Sending + Receiving Data
public class MyHostApduService
extends HostApduService {
public byte[] processCommandApdu(byte[]apdu,
Bundle extras) {}
public void onDeactivated(int reason) {}
}
Google Confidential and Proprietary
25. Sending + Receiving Data
public byte[] processCommandApdu(byte[] apdu,
Bundle extras) {}
Return byte[ ]
which get sent to
the reader
Google Confidential and Proprietary
Receive byte[ ]
when function
gets called
26. Sending + Receiving Data
public byte[] processCommandApdu(byte[] apdu,
Bundle extras) {}
Since this is called on the main thread, you should return
ASAP. If you need to do processing, return null. Then call
sendResponseApdu() later.
Google Confidential and Proprietary
27. Reader APIs
HCE lets your phone act as a NFC card
With the Reader APIs, your phone can also act
as an NFC terminal
Testing is convenient since you can use two
phones to simulate a NFC card and a reader
Google Confidential and Proprietary
28. Use Cases - Loyalty
Google Confidential and Proprietary
29. Use Cases - Building access
Google Confidential and Proprietary
30. Use Cases - Transit
Google Confidential and Proprietary
31. NFC - The Future
400M NFC smart phones shipped in 2014.
By October 2015, Chip & Pin cards will replace
regular cards in the US. This means new
terminals which probably have NFC
By 2017, 32% of all actively used smart phones
will have NFC (2.1B phones)
Google Confidential and Proprietary
32. Conclusion
HCE allows an NFC reader to directly
communicate with your Android app with just
a tap
With the Reader APIs, your phone can also act
as an NFC terminal
NFC has the potential to be really big, but we
need developers like you for novel apps!
Google Confidential and Proprietary
34. Google Confidential and Proprietary
Thanks!
Stop by the NFC Forum booth #401 to learn more
about the possibilities of developing with NFC.
Enter your name for a chance to win a Sony
Action Cam with GPS!