Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
NFC & RFID
with Android



     Tod E. Kurt, ThingM
Where 2.0 2011, Santa Clara, CA
What is this talk?
Why you should care about RFID & NFC

Overview of what RFID & NFC is technically


                  Ho...
Who is this guy?
 @todbot does...

Crystal Monster




                            BlinkM Smart LEDs




             Scre...
Why Should I Care About RFID?


    Exxon           Mastercard PayPass        Identification
SpeedPass
            Financia...
Why Should I Care About NFC?
Some of the things NFC promises...




                                     http://www.nfc-fo...
Also...
Why I like RFID
ThingM: WineM
                                             AFK: SeaWorld in Dubai




         ThingM: Gho...
RFID
RFID is Easy




RFID tag – just a serial number, a unique ID
UID 32-bit or 56-bit
Some tags UP TO 4kB! (wow!) of writeabl...
Why RFID instead of...

...barcodes
– can have a lot more data, no ugly barcode

...QR codes
– can write data, no camera l...
What RFID is Not

NOT localization

NOT proximity detection

NOT fast data transfer

NOT secure (for non-smartcard)



Be ...
How RFID works




“reader”                         “tag”
expensive ($10)                cheap ($0.10)
Passive Tag Internals
Some Interesting RFID Examples
Waterpark ticket




day-pass vs season pass

age-based restrictions

payment of food, beverages, merchandise
Casino Chips Theft Fail
                             man steals $1.5M in chips,
                             cashes them i...
NFC
NFC: Near Field Communication
                             web-like semantics for RFID


                                 ...
NFC Technical Architecture




                  http://www.nfc-forum.org/
NDEF: NFC data exchange format
        some example NDEF formats




                                    http://wiki.forum...
Some cool NFC ideas

Tap Your Top10 – Send top 10 list to DJ by tapping phone



HouseMood – Tap your house so it knows yo...
NFC Capabilities on Android

Currently available Android NFC phones: Google Nexus S



Use Android 2.3.3 (API Level 10) as...
What works now on Android?


  Tag reader/writer

  Tag emulation (of certain NFC NDEF tags)

  P2P communication (Android...
What doesn’t work


Tag emulation of Smart Cards

Peer-to-peer with Nokia NFC phones
Nexus S NFC Hardware
Current App Landscape
taglet & AnyTag


        “bit.ly for RFID tags”

        maps UID –> URL

        works with any tag phone can read

    ...
Tags App
           System App



           Two functions:

           - tag reader

           - tag emulator



       ...
NFC TagInfo
  most useful
NXP TagWriter
lets you format tags for NDEF use
NXP TagWriter
App Demos
Let’s try to show some demos...
Developing NFC on Android


Disclaimer: I’m not a big Android programmer.

Good docs at http://developer.android.com/guide...
Quick Android SDK Setup Intro

Android apps are written in Java using Eclipse IDE



Install Eclipse (or other favorite ID...
App Activity lifecycle

              Apps have at least one Activity

              Activities triggered from system
    ...
Main Steps to add NFC

■ Edit app’s AndroidManifest.xml, set:

 ■ Minimum SDK version

 ■ Hardware permissions

 ■ Intent ...
Permissions in Manifest


Set SDK version to get to NFC APIs:

<uses-sdk android:minSdkVersion="10"/>


Request permission...
Intent Filter in Manifest
NFC intent filters tell Android your Activity can handle NFC
And let you control what kind of tag...
Intent Filter
            Can even filter on NFC mime-type


<intent‐filter>



<action
android:name="android.nfc.action.ND...
TechFilter
  Filter for what kind of tag hardware you care about

<resources
xmlns:xliff="urn:oasis:names:tc:xliff:documen...
Get Tag Data
            In onCreate() if using intent filters,

            or anywhere using foreground dispatch


Intent...
FakeTagsActivity
Hacking NFC
                        not on Android




Get a USB or serial reader

Get some tags (SF Muni Clipper, your pr...
Touchatag
           http://touchatag.com




Inexpensive ($40) USB NFC reader

Comes with 10 read-only 64-byte tags

Work...
Proxmark
http://www.proxmark.org/


                           GPL RFID hardware reader

                           Build ...
SonMicro RFID
  http://sonmicro.com


                        13.56 MHz RFID reader

                        Libraries for...
LibNFC
           http://www.libnfc.org/




Multi-platform library for NFC exploration

Works with most all NFC/RFID USB ...
Open NFC
http://www.open-nfc.org/
TagAge.net

             Create custom NFC
             tags with custom
             graphics, all online
Links

http://developer.android.com/sdk/android-2.3.3.html

http://developer.android.com/guide/topics/nfc/index.html

http...
Thank You




imagine these guys with NFC tags
Thank You




imagine these guys with NFC tags
Tod E. Kurt
http://thingm.com/
http://todbot.com/blog/
Upcoming SlideShare
Loading in …5
×

of

NFC & RFID on Android Slide 1 NFC & RFID on Android Slide 2 NFC & RFID on Android Slide 3 NFC & RFID on Android Slide 4 NFC & RFID on Android Slide 5 NFC & RFID on Android Slide 6 NFC & RFID on Android Slide 7 NFC & RFID on Android Slide 8 NFC & RFID on Android Slide 9 NFC & RFID on Android Slide 10 NFC & RFID on Android Slide 11 NFC & RFID on Android Slide 12 NFC & RFID on Android Slide 13 NFC & RFID on Android Slide 14 NFC & RFID on Android Slide 15 NFC & RFID on Android Slide 16 NFC & RFID on Android Slide 17 NFC & RFID on Android Slide 18 NFC & RFID on Android Slide 19 NFC & RFID on Android Slide 20 NFC & RFID on Android Slide 21 NFC & RFID on Android Slide 22 NFC & RFID on Android Slide 23 NFC & RFID on Android Slide 24 NFC & RFID on Android Slide 25 NFC & RFID on Android Slide 26 NFC & RFID on Android Slide 27 NFC & RFID on Android Slide 28 NFC & RFID on Android Slide 29 NFC & RFID on Android Slide 30 NFC & RFID on Android Slide 31 NFC & RFID on Android Slide 32 NFC & RFID on Android Slide 33 NFC & RFID on Android Slide 34 NFC & RFID on Android Slide 35 NFC & RFID on Android Slide 36 NFC & RFID on Android Slide 37 NFC & RFID on Android Slide 38 NFC & RFID on Android Slide 39 NFC & RFID on Android Slide 40 NFC & RFID on Android Slide 41 NFC & RFID on Android Slide 42 NFC & RFID on Android Slide 43 NFC & RFID on Android Slide 44 NFC & RFID on Android Slide 45 NFC & RFID on Android Slide 46 NFC & RFID on Android Slide 47 NFC & RFID on Android Slide 48 NFC & RFID on Android Slide 49 NFC & RFID on Android Slide 50 NFC & RFID on Android Slide 51 NFC & RFID on Android Slide 52 NFC & RFID on Android Slide 53
Upcoming SlideShare
RFID: Past, Present, and Future
Next

229 Likes

Share

NFC & RFID on Android

The Google Nexus S offers support for Near Field Communication (NFC), an extension to an RFID smart card protocol popularly used for secure access, metro passes (Oyster/Clipper), and electronic money (FeliCa/Octopus). NFC in smartphones promises adding these features to the phone you carry by allowing the it to emulate both RFID tag and reader.

NFC additionally adds new capabilities like exchanging configuration data such as WiFi settings, trading vCard contact information, reading URLs, triggering SMS text messages or initiating calls, and secure bi-directional communication between NFC devices.

This session will cover what NFC and RFID is and is not, what Android on the Nexus S is currently capable of, and some examples of how to add NFC to your apps.

http://where2conf.com/where2011/public/schedule/detail/18443

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

NFC & RFID on Android

  1. 1. NFC & RFID with Android Tod E. Kurt, ThingM Where 2.0 2011, Santa Clara, CA
  2. 2. What is this talk? Why you should care about RFID & NFC Overview of what RFID & NFC is technically How Android implements NFC What Android can and cannot do Some existing Android apps Tips on how to add NFC to your Android app Non-Android NFC hacking
  3. 3. Who is this guy? @todbot does... Crystal Monster BlinkM Smart LEDs ScrewShield Spooky Arduino Wiichuck adapter
  4. 4. Why Should I Care About RFID? Exxon Mastercard PayPass Identification SpeedPass Financial Transactions Asset tracking Access control SF Muni Clipper pass Supply chain
  5. 5. Why Should I Care About NFC? Some of the things NFC promises... http://www.nfc-forum.org
  6. 6. Also...
  7. 7. Why I like RFID ThingM: WineM AFK: SeaWorld in Dubai ThingM: Ghost Tours at Henry Ford !
  8. 8. RFID
  9. 9. RFID is Easy RFID tag – just a serial number, a unique ID UID 32-bit or 56-bit Some tags UP TO 4kB! (wow!) of writeable data
  10. 10. Why RFID instead of... ...barcodes – can have a lot more data, no ugly barcode ...QR codes – can write data, no camera lag, no ugly qr code ...Bluetooth – cheaper, low-overhead, easier setup ...WiFi / GPS localization – cheap, definite, closely-spaced location
  11. 11. What RFID is Not NOT localization NOT proximity detection NOT fast data transfer NOT secure (for non-smartcard) Be careful using it for identification, use it instead for fun
  12. 12. How RFID works “reader” “tag” expensive ($10) cheap ($0.10)
  13. 13. Passive Tag Internals
  14. 14. Some Interesting RFID Examples
  15. 15. Waterpark ticket day-pass vs season pass age-based restrictions payment of food, beverages, merchandise
  16. 16. Casino Chips Theft Fail man steals $1.5M in chips, cashes them in for $0 and jail “RFID can void the stolen chips, like a registration that’s no longer valid,” Kendall said. “When we manufacture RFID-embedded chips and send them to a casino, they’re not worth anything until they register the codes. Until then, they’re nothing but freight.”
  17. 17. NFC
  18. 18. NFC: Near Field Communication web-like semantics for RFID Built on existing RFID tech Multi-part, mime-typed, textual data Devices can have 3 modes: - tag reader/writer Nokia 3220 NFC - tag emulation - peer-to-peer data transfer NFC products available since 2005
  19. 19. NFC Technical Architecture http://www.nfc-forum.org/
  20. 20. NDEF: NFC data exchange format some example NDEF formats http://wiki.forum.nokia.com/
  21. 21. Some cool NFC ideas Tap Your Top10 – Send top 10 list to DJ by tapping phone HouseMood – Tap your house so it knows your mood HiRes 4SQ – Precise, hyper-dense checkins with foursquare
  22. 22. NFC Capabilities on Android Currently available Android NFC phones: Google Nexus S Use Android 2.3.3 (API Level 10) as the NFC APIs drastically changed from 2.3.2. New Intent Filter and TechFilter APIs for registering interest in types of cards, types of NDEF messages, types of NFC events
  23. 23. What works now on Android? Tag reader/writer Tag emulation (of certain NFC NDEF tags) P2P communication (Android-specific)
  24. 24. What doesn’t work Tag emulation of Smart Cards Peer-to-peer with Nokia NFC phones
  25. 25. Nexus S NFC Hardware
  26. 26. Current App Landscape
  27. 27. taglet & AnyTag “bit.ly for RFID tags” maps UID –> URL works with any tag phone can read but both don’t seem to work on 2.3.3
  28. 28. Tags App System App Two functions: - tag reader - tag emulator Makes sharing contact info & URLs easy
  29. 29. NFC TagInfo most useful
  30. 30. NXP TagWriter lets you format tags for NDEF use
  31. 31. NXP TagWriter
  32. 32. App Demos Let’s try to show some demos...
  33. 33. Developing NFC on Android Disclaimer: I’m not a big Android programmer. Good docs at http://developer.android.com/guide/topics/nfc/ go read them. Instead, look at the process from a high level And at the lower-level setup and gotchas
  34. 34. Quick Android SDK Setup Intro Android apps are written in Java using Eclipse IDE Install Eclipse (or other favorite IDE) Download Android SDK Hook Android SDK up to Eclipse Tell SDK to download needed extra packages Then you can start a new Eclipse Android project
  35. 35. App Activity lifecycle Apps have at least one Activity Activities triggered from system events, “intents” Activities are paused & resumed by Android system
  36. 36. Main Steps to add NFC ■ Edit app’s AndroidManifest.xml, set: ■ Minimum SDK version ■ Hardware permissions ■ Intent filters ■ Two ways to work: ■ Intent Dispatch – run your Activity on tag presence ■ Foreground Dispatch – intercept tag intents
  37. 37. Permissions in Manifest Set SDK version to get to NFC APIs: <uses-sdk android:minSdkVersion="10"/> Request permission from the user to use NFC hardware: <uses‐permission
android:name="android.permission.NFC">
  38. 38. Intent Filter in Manifest NFC intent filters tell Android your Activity can handle NFC And let you control what kind of tags your Activity sees <intent-filter>   <action android:name="android.nfc.action.NDEF_DISCOVERED"/>   <data android:mimeType="mime/type" /> </intent-filter> <intent-filter>   <action android:name="android.nfc.action.TECH_DISCOVERED"/>   <meta-data android:name="android.nfc.action.TECH_DISCOVERED"                 android:resource="@xml/nfc_tech_filter.xml" /> </intent-filter> <intent-filter>   <action android:name="android.nfc.action.TAG_DISCOVERED"/> </intent-filter>
  39. 39. Intent Filter Can even filter on NFC mime-type <intent‐filter> 

<action
android:name="android.nfc.action.NDEF_DISCOVERED"/> 

<data
android:mimeType="text/x‐vcard"/> 

<category
android:name="android.intent.category.DEFAULT"/> </intent‐filter>
  40. 40. TechFilter Filter for what kind of tag hardware you care about <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">     <tech-list>         <tech>android.nfc.tech.IsoDep</tech>         <tech>android.nfc.tech.NfcA</tech>                 <tech>android.nfc.tech.NfcB</tech>         <tech>android.nfc.tech.NfcF</tech>         <tech>android.nfc.tech.NfcV</tech>         <tech>android.nfc.tech.Ndef</tech>         <tech>android.nfc.tech.NdefFormatable</tech>         <tech>android.nfc.tech.MifareClassic</tech>         <tech>android.nfc.tech.MifareUltralight</tech>     </tech-list> </resources>
  41. 41. Get Tag Data In onCreate() if using intent filters, or anywhere using foreground dispatch Intent intent = getIntent(); NdefMessage[] msgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGESs); for (int i = 0; i < msgs.length; i++) { NdefRecord[] records = msgs[i].getRecords(); }
  42. 42. FakeTagsActivity
  43. 43. Hacking NFC not on Android Get a USB or serial reader Get some tags (SF Muni Clipper, your prox card, etc.) Get some apps Hook it up to your PC or Arduino
  44. 44. Touchatag http://touchatag.com Inexpensive ($40) USB NFC reader Comes with 10 read-only 64-byte tags Works with libnfc
  45. 45. Proxmark http://www.proxmark.org/ GPL RFID hardware reader Build it yourself, if you’re hardcore Read/emulate any RFID tag $300
  46. 46. SonMicro RFID http://sonmicro.com 13.56 MHz RFID reader Libraries for Processing & Arduino Read/write tags Limited NFC, no emulation $30 avail from SparkFun
  47. 47. LibNFC http://www.libnfc.org/ Multi-platform library for NFC exploration Works with most all NFC/RFID USB readers Understands most all NFC/RFID tag types Active developer community
  48. 48. Open NFC http://www.open-nfc.org/
  49. 49. TagAge.net Create custom NFC tags with custom graphics, all online
  50. 50. Links http://developer.android.com/sdk/android-2.3.3.html http://developer.android.com/guide/topics/nfc/index.html http://developer.android.com/reference/android/nfc/NfcAdapter.html http://www.rfid-handbook.com/rfid/ http://www.nfc-research.at/ http://www.nfc-forum.org/ http://www.proxmark.org/
  51. 51. Thank You imagine these guys with NFC tags
  52. 52. Thank You imagine these guys with NFC tags
  53. 53. Tod E. Kurt http://thingm.com/ http://todbot.com/blog/
  • yarsench

    Jul. 20, 2021
  • amer8587

    Jan. 25, 2021
  • PRUMSoksan

    Oct. 20, 2020
  • meharkarthikvundaval

    Mar. 4, 2020
  • ssuser3d3f8d

    Jun. 18, 2019
  • ArbaazSo

    Jun. 8, 2019
  • garyfitzroy

    Apr. 2, 2019
  • Thejeshkn

    Mar. 19, 2019
  • MeghamalaGunnam

    Feb. 5, 2019
  • mahmudalnassery

    Dec. 25, 2017
  • MathanKumar129

    Dec. 14, 2017
  • dhazaan

    Oct. 2, 2017
  • GeorgesonAcompaado

    Sep. 21, 2017
  • limenos

    Aug. 1, 2017
  • AnggerPrasetyo

    May. 30, 2017
  • lovedream888

    Mar. 29, 2017
  • VaishuRaj2

    Mar. 20, 2017
  • hamzamu

    Mar. 11, 2017
  • stacy718

    Mar. 7, 2017
  • SaqibFaraz1

    Feb. 15, 2017

The Google Nexus S offers support for Near Field Communication (NFC), an extension to an RFID smart card protocol popularly used for secure access, metro passes (Oyster/Clipper), and electronic money (FeliCa/Octopus). NFC in smartphones promises adding these features to the phone you carry by allowing the it to emulate both RFID tag and reader. NFC additionally adds new capabilities like exchanging configuration data such as WiFi settings, trading vCard contact information, reading URLs, triggering SMS text messages or initiating calls, and secure bi-directional communication between NFC devices. This session will cover what NFC and RFID is and is not, what Android on the Nexus S is currently capable of, and some examples of how to add NFC to your apps. http://where2conf.com/where2011/public/schedule/detail/18443

Views

Total views

204,378

On Slideshare

0

From embeds

0

Number of embeds

61,628

Actions

Downloads

0

Shares

0

Comments

0

Likes

229

×