Android NFC Workshop
@JamesElsey1986
@Smart421
Android NFC Workshop MobDevCon 2013
Android NFC Workshop MobDevCon 2013
Android NFC Workshop MobDevCon 2013
Android NFC Workshop MobDevCon 2013
Android NFC Workshop MobDevCon 2013
Agenda
1. Overview of tags and NDEF
a. Types of tags
b. Tag Dispatch System
c. Different NDEF messages
d. Legacy tags
2. Read a plain text tag
3. Write a plain text tag
4. Write a URI tag
5. Android application records (AAR)
6. Beaming data between devices
What is an NFC tag?
NFC Forum
Types of NFC Tag
Type 1 Tag Type 2 Tag Type 3 Tag Type 4 Tag
Compatible Products Broadcom
Topaz
NXP Mifare
Ultralight, NXP
Mifare Ultralight C,
NXP NTAG203
Sony FeliCa NXP DESFire / NXP
SmartMX-JCOP
Memory Size 96 Bytes 48 Bytes / 144
Bytes
1, 4, 9 KB 4 KB /32 KB
Unit Price Low Low High Medium I High
Data Access Read/Write or
Read-Only
Read/Write or
Read-Only
Read/Write or
Read-Only
Read/Write or Read-
Only
source: http://www.nfctags.com/nfc-applications-which-tag
Variations of Type 2 tags
Source : http://rapidnfc.com/which_nfc_chip
Ultralight Ultralight C NTAG203
Memory Size 64 bytes 192 bytes 168 bytes
User Memory 46 bytes 137 bytes 137 bytes
URL Length 41 chars 132 chars 132 chars
Text Length 39 chars 130 chars 130 chars
Best Use Cost effective,
short URL,
smart poster and
general NFC
use.
For applications
required
encryption tech
only.
Latest chip, best
performance.
Great for
everything from
marketing to
task launcher
apps.
Cost £0.40 £0.80 £0.40
NDEF
Tag Dispatch System
What happens when a tag is detected?
1.Analyse the tag
2.Categorise the data
3.Start an application that is interested in the
categorised data
Applications declare intent filters to request the
ability to handle the data
Tag Dispatch System
Enabling NFC in your app
1. Request permission to the NFC hardware
o <uses-permission android:name="android.permission.NFC" />
1. Set SDK level
o <uses-sdk android:minSdkVersion="10"/>
1. (optionally) Set uses feature so app only shows on Google Play if the
device has NFC hardware
o <uses-feature android:name="android.hardware.nfc"
android:required="true" />
Reading a plain text tag
1. Grab the intent
2. Check if action is
ACTION_NDEF_DISCOVERED
3. Get EXTRA_NDEF_MESSAGES from the
extras bundle
1. Extract the payloads from the NdefRecords
Reading a plain text tag
(demo time)
Writing a tag
byte[] langBytes = locale.getLanguage().getBytes(Charset.forName("US-ASCII"));
Charset utfEncoding = encodeInUtf8 ? Charset.forName("UTF-8") : Charset.forName("UTF-16");
byte[] textBytes = payload.getBytes(utfEncoding);
int utfBit = encodeInUtf8 ? 0 : (1 << 7);
char status = (char) (utfBit + langBytes.length);
byte[] data = new byte[1 + langBytes.length + textBytes.length];
data[0] = (byte) status;
System.arraycopy(langBytes, 0, data, 1, langBytes.length);
System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length);
return new NdefRecord(NdefRecord.TNF_WELL_KNOWN,
NdefRecord.RTD_TEXT, new byte[0], data);
}
private NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {
Write a plain text tag
(demotime!)
Write a URI to a tag
• Same as plain text
• Use RTD_URI instead of RTD_TEXT
Write protecting a tag
Formatted Tags:
ndef.connect();
ndef.writeNdefMessage(message);
ndef.makeReadOnly()
Make read only during format:
format.connect();
format.formatReadOnly(message);
Android Application Records
• Introduced in 4.0
• Ensures application is opened if available
• Directs to marketplace if not installed
NdefRecord.createApplicationRecord(
"com.example.android.beam”)
Android Application Records
(demo time)
Google I/O 2011 - How to NFC
http://www.youtube.com/watch?v=49L7z3rxz4Q
Beaming Data between devices
Best Practices
• Avoid intent chooser!
• Write protect tags where possible
• Move the NFC read/writing off the main
thread
• Use a wrapper such as Ndef tools for
android
Resources
Android SDK docs for NFC
http://developer.android.com/guide/topics/connectivity/nfc/nfc.html
Google I/O NFC video
http://www.youtube.com/watch?v=49L7z3rxz4Q
Excellent overview on NDEF standards http://
ibadrinath.blogspot.co.uk/2012/07/nfc-data-exchange-format-ndef.html
NDEF Tools for Android
https://code.google.com/p/ndef-tools-for-android/
Usages of NFC?
• At work
• In the car
• In your wallet
• In the gym
& more!
Where to get NFC Tags?
• http://rapidnfc.com/
QA
Thanks for attending!
@jameselsey1986

More Related Content

PDF
Automating Your Life: A look at NFC
PDF
NFC Standard Essential Patent Candidates Data 4Q 2014
PPT
ACR122L VisualVantage Serial NFC Reader with LCD
PDF
Global tag portfolio_2015
PDF
Electronic Access Control Security
PPT
DC4420 2014 - NFC - The Non-Radio Bits
PPTX
Near field communication(NFC)
PDF
Electronic Access Control Security / Безопасность электронных систем контроля...
Automating Your Life: A look at NFC
NFC Standard Essential Patent Candidates Data 4Q 2014
ACR122L VisualVantage Serial NFC Reader with LCD
Global tag portfolio_2015
Electronic Access Control Security
DC4420 2014 - NFC - The Non-Radio Bits
Near field communication(NFC)
Electronic Access Control Security / Безопасность электронных систем контроля...

What's hot (20)

PDF
Rfid security workshop v0.9 -nahuel_grisolia
PDF
NFCRFID Ripe for Application Expansion_ElectronicDesign
PDF
Overview chip
PPT
Nullcon 2011 RFID - NÂO ENVIADO AO EVENTO
PDF
ACR128 product presentation by Advanced Card Systems Ltd.
PPT
PPTX
Bluetooth Secure Simple Pairing Using NFC Part 1
PDF
Lp 2010 operation-theory
PDF
Talk-ID Engels (1)
PPTX
NFC Technology
PDF
Cours NFC 2019
PPT
10.1
PPT
It nfc presentation
PPTX
Other types of networks: Bluetooth, Zigbee, & NFC
PDF
DefCon 2012 - Near-Field Communication / RFID Hacking - Miller
PDF
2008 07 - ss - near field communication
PDF
RFID Update for National Acquisitions Group Conference, York 2013
PDF
Windows (Phone) 8 NFC App Scenarios
PPTX
NEAR FIELD COMMUNICATION
PPTX
Near field communication
Rfid security workshop v0.9 -nahuel_grisolia
NFCRFID Ripe for Application Expansion_ElectronicDesign
Overview chip
Nullcon 2011 RFID - NÂO ENVIADO AO EVENTO
ACR128 product presentation by Advanced Card Systems Ltd.
Bluetooth Secure Simple Pairing Using NFC Part 1
Lp 2010 operation-theory
Talk-ID Engels (1)
NFC Technology
Cours NFC 2019
10.1
It nfc presentation
Other types of networks: Bluetooth, Zigbee, & NFC
DefCon 2012 - Near-Field Communication / RFID Hacking - Miller
2008 07 - ss - near field communication
RFID Update for National Acquisitions Group Conference, York 2013
Windows (Phone) 8 NFC App Scenarios
NEAR FIELD COMMUNICATION
Near field communication
Ad

Viewers also liked (20)

PPTX
Nfc reader writer_mode
PPTX
Android Application Development of NFC Reader-Writer Mode
PDF
Embedded Systems Security News 2011/05
PPTX
NFC (Windows 8/ Windows Phone 8 )
PPTX
Sensor id overview_ppt
PPTX
Standards for the Future of Java Embedded (16:9)
PPTX
geecon 2013 - Standards for the Future of Java Embedded
PDF
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivity
PPTX
DevBy. Apple Watch Kit 1.0 (RU) & NFC
PPTX
The Eclipse M2M IWG and Standards for the Internet of Things
PDF
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
PPTX
Latest wireless technology
PPTX
OPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
PDF
NFC and Android applications
PPT
Introduction to the Interoperability Initiative
PDF
Transit Ticketing and Fare Collection Conference - Introduction to the Intero...
PDF
便利なNFC ~利用シーンと技術の動向~
PDF
NFC Mobile Payments 2016 What’s Next?
PPTX
Near Field Communication in m-Commerce
PDF
RFID2015_NFC-WISP_public(delete Disney research)
Nfc reader writer_mode
Android Application Development of NFC Reader-Writer Mode
Embedded Systems Security News 2011/05
NFC (Windows 8/ Windows Phone 8 )
Sensor id overview_ppt
Standards for the Future of Java Embedded (16:9)
geecon 2013 - Standards for the Future of Java Embedded
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivity
DevBy. Apple Watch Kit 1.0 (RU) & NFC
The Eclipse M2M IWG and Standards for the Internet of Things
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
Latest wireless technology
OPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
NFC and Android applications
Introduction to the Interoperability Initiative
Transit Ticketing and Fare Collection Conference - Introduction to the Intero...
便利なNFC ~利用シーンと技術の動向~
NFC Mobile Payments 2016 What’s Next?
Near Field Communication in m-Commerce
RFID2015_NFC-WISP_public(delete Disney research)
Ad

Similar to Android NFC Workshop MobDevCon 2013 (20)

PPTX
NFC Bootcamp Seattle Day 2
PPTX
Nfc on Android
PDF
Porting Android
PDF
Porting Android ABS 2011
PPT
Near field communication (NFC) in android
PDF
Breaking New Frontiers in Robotics and Edge Computing with AI
PDF
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
KEY
NFC & RFID on Android
PPTX
Introduction to NFC
PDF
Porting Android
PDF
Auditing the Opensource Kernels
PPTX
เทคโนโลยีสารสนเทศสำหรับครู
PDF
Tos tutorial
PDF
Android memory analysis Debug slides.pdf
PPT
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
PPTX
A New Framework for Detection
KEY
NFC on Android - Near Field Communication
PDF
BKK16-103 OpenCSD - Open for Business!
PPTX
4055-841_Project_ShailendraSadh
NFC Bootcamp Seattle Day 2
Nfc on Android
Porting Android
Porting Android ABS 2011
Near field communication (NFC) in android
Breaking New Frontiers in Robotics and Edge Computing with AI
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
NFC & RFID on Android
Introduction to NFC
Porting Android
Auditing the Opensource Kernels
เทคโนโลยีสารสนเทศสำหรับครู
Tos tutorial
Android memory analysis Debug slides.pdf
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
A New Framework for Detection
NFC on Android - Near Field Communication
BKK16-103 OpenCSD - Open for Business!
4055-841_Project_ShailendraSadh

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Five Habits of High-Impact Board Members
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Architecture types and enterprise applications.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
PPT
What is a Computer? Input Devices /output devices
PDF
Unlock new opportunities with location data.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
The various Industrial Revolutions .pptx
Assigned Numbers - 2025 - Bluetooth® Document
Zenith AI: Advanced Artificial Intelligence
Hindi spoken digit analysis for native and non-native speakers
Five Habits of High-Impact Board Members
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
A novel scalable deep ensemble learning framework for big data classification...
Developing a website for English-speaking practice to English as a foreign la...
WOOl fibre morphology and structure.pdf for textiles
A comparative study of natural language inference in Swahili using monolingua...
Architecture types and enterprise applications.pdf
Getting Started with Data Integration: FME Form 101
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
observCloud-Native Containerability and monitoring.pptx
What is a Computer? Input Devices /output devices
Unlock new opportunities with location data.pdf

Android NFC Workshop MobDevCon 2013

  • 7. Agenda 1. Overview of tags and NDEF a. Types of tags b. Tag Dispatch System c. Different NDEF messages d. Legacy tags 2. Read a plain text tag 3. Write a plain text tag 4. Write a URI tag 5. Android application records (AAR) 6. Beaming data between devices
  • 8. What is an NFC tag?
  • 10. Types of NFC Tag Type 1 Tag Type 2 Tag Type 3 Tag Type 4 Tag Compatible Products Broadcom Topaz NXP Mifare Ultralight, NXP Mifare Ultralight C, NXP NTAG203 Sony FeliCa NXP DESFire / NXP SmartMX-JCOP Memory Size 96 Bytes 48 Bytes / 144 Bytes 1, 4, 9 KB 4 KB /32 KB Unit Price Low Low High Medium I High Data Access Read/Write or Read-Only Read/Write or Read-Only Read/Write or Read-Only Read/Write or Read- Only source: http://www.nfctags.com/nfc-applications-which-tag
  • 11. Variations of Type 2 tags Source : http://rapidnfc.com/which_nfc_chip Ultralight Ultralight C NTAG203 Memory Size 64 bytes 192 bytes 168 bytes User Memory 46 bytes 137 bytes 137 bytes URL Length 41 chars 132 chars 132 chars Text Length 39 chars 130 chars 130 chars Best Use Cost effective, short URL, smart poster and general NFC use. For applications required encryption tech only. Latest chip, best performance. Great for everything from marketing to task launcher apps. Cost £0.40 £0.80 £0.40
  • 12. NDEF
  • 13. Tag Dispatch System What happens when a tag is detected? 1.Analyse the tag 2.Categorise the data 3.Start an application that is interested in the categorised data Applications declare intent filters to request the ability to handle the data
  • 15. Enabling NFC in your app 1. Request permission to the NFC hardware o <uses-permission android:name="android.permission.NFC" /> 1. Set SDK level o <uses-sdk android:minSdkVersion="10"/> 1. (optionally) Set uses feature so app only shows on Google Play if the device has NFC hardware o <uses-feature android:name="android.hardware.nfc" android:required="true" />
  • 16. Reading a plain text tag 1. Grab the intent 2. Check if action is ACTION_NDEF_DISCOVERED 3. Get EXTRA_NDEF_MESSAGES from the extras bundle 1. Extract the payloads from the NdefRecords
  • 17. Reading a plain text tag (demo time)
  • 18. Writing a tag byte[] langBytes = locale.getLanguage().getBytes(Charset.forName("US-ASCII")); Charset utfEncoding = encodeInUtf8 ? Charset.forName("UTF-8") : Charset.forName("UTF-16"); byte[] textBytes = payload.getBytes(utfEncoding); int utfBit = encodeInUtf8 ? 0 : (1 << 7); char status = (char) (utfBit + langBytes.length); byte[] data = new byte[1 + langBytes.length + textBytes.length]; data[0] = (byte) status; System.arraycopy(langBytes, 0, data, 1, langBytes.length); System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length); return new NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, new byte[0], data); } private NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {
  • 19. Write a plain text tag (demotime!)
  • 20. Write a URI to a tag • Same as plain text • Use RTD_URI instead of RTD_TEXT
  • 21. Write protecting a tag Formatted Tags: ndef.connect(); ndef.writeNdefMessage(message); ndef.makeReadOnly() Make read only during format: format.connect(); format.formatReadOnly(message);
  • 22. Android Application Records • Introduced in 4.0 • Ensures application is opened if available • Directs to marketplace if not installed NdefRecord.createApplicationRecord( "com.example.android.beam”)
  • 24. Google I/O 2011 - How to NFC http://www.youtube.com/watch?v=49L7z3rxz4Q
  • 26. Best Practices • Avoid intent chooser! • Write protect tags where possible • Move the NFC read/writing off the main thread • Use a wrapper such as Ndef tools for android
  • 27. Resources Android SDK docs for NFC http://developer.android.com/guide/topics/connectivity/nfc/nfc.html Google I/O NFC video http://www.youtube.com/watch?v=49L7z3rxz4Q Excellent overview on NDEF standards http:// ibadrinath.blogspot.co.uk/2012/07/nfc-data-exchange-format-ndef.html NDEF Tools for Android https://code.google.com/p/ndef-tools-for-android/
  • 28. Usages of NFC? • At work • In the car • In your wallet • In the gym & more!
  • 29. Where to get NFC Tags? • http://rapidnfc.com/
  • 30. QA

Editor's Notes

  • #3: My name is James Elsey, I ’ m a software developer at Smart421 working on a variety of enterprise java applications, and more recently mobile applications.
  • #4: I ’ m currently working at O2…
  • #5: … Working with this stuff
  • #6: … But secretly love doing this stuff
  • #8: Todays session will take just over an hour, we have a lot to get through, and time permitting we can achieve this. We have about 10 minutes of slides, and then will jump into some coding At the end of the session I ’ ll take QA, and provide links to the slides, source code, references, and my details should you have anything you want to ask me about Firstly we ’ ll cover some of the basics of NFC and the NDEF format, then we ’ ll jump in to reading/writing plain text tags. We ’ ll then have a look at writing URI tags. After that we ’ ll discuss a few of the NFC goodies that have been introduced with Ice cream sandwich such as android application records for ensuring that your app is launched or downloaded, and then beaming data between devices. AAR for zxing : com.google.zxing.client.android
  • #9: So, what is an NFC tag? They look very similar to RFID tags that you may have seen on the back of CDs and DVDs whilst browsing at your favourite music store. They often come in sticker format but you can also buy wristbands, keyrings, business cards etc with NFC tags embedded. NFC != RFID RFID has a greater range , meters rather than centimeters RFID is one way, you read a tag and that is it NFC 3 modes: Read/write – for tags Peer to peer – Android beaming. 4.1 jelly bean introduced advanced beaming where a bluetooth connection is established to transfer more data Card Emulation
  • #10: In 2004 Sony, Nokia and Phillips founded the NFC forum Now has over 170 members, including : Google Intel HP LG Various financial companies Visa Barclaycard American Express Mastercard Proxama are also a member of the forum
  • #11: In 2007 the NFC Forum published the specification for 4 types of NFC tags. The key differences between the tags are their memory sizes and read/write speeds. Probably most likely to use type 2 tags Type 2 tags come in 2 flavours, 48 bytes and 144 bytes. The white tags are type2 144. Usages Type 1 - Type 2 - Mifare Ultralight – Cheap and often disposable, used in Football world cup 2006 Germany - NTAG203, according to ZipNFC (sellers) is by far the most popular tag. Type 3 – Type 4 - NXP DESFire – Oyster card (was using Mifare classic)
  • #12: As you can see there are some variations of type 2 tags. The ultralight tags generally speaking wont have enough space to store an AAR unless the package name is really short. NTAG203’s are the white round stickers, they’re good general purpose tags with enough capacity to store AARs and urls.
  • #13: There are typically 1 NDEF Message in a tag and for the most part you can safely work against this assumption The NDEF message may have multiple NDEF Records in a tag Identifier - Rarely used, but can be used to uniquely identify your tag 3-bit TNF (Type Name Format) Indicates how to interpret the variable length type field. Valid values are described in described in Table 1 . such as TNF_WELL_KNOWN or TNF_MIME_MEDIA Variable length type Describes the type of the record. If using TNF_WELL_KNOWN , use this field to specify the Record Type Definition (RTD). Valid RTD values are described in Table 2 . such as RTD_URI or RTD_TEXT Variable length ID A unique identifier for the record. This field is not used often, but if you need to uniquely identify a tag, you can create an ID for it. Variable length payload The actual data payload that you want to read or write. An NDEF message can contain multiple NDEF records, so don&apos;t assume the full payload is in the first NDEF record of the NDEF message.
  • #14: Responsible for working out what to do with a tag when it is discovered Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload in the tag. Encapsulating the MIME type or URI and the payload into an intent. These first two steps are described in How NFC tags are mapped to MIME types and URIs . Starts an activity based on the intent. This is described in How NFC Tags are Dispatched to Applications .
  • #15: IF an NDEF tag is discovered, android checks to see if anything is registered to handle NDEF discovered, otherwise it checks TECH_DISCOVERED
  • #16: Firstly you need to add the uses-permission into the manifest to request usage of the hardware Next you need to set the minSDK level (2.3 - 2.3.2 Gingerbread) - API level 9 only supports limited tag dispatch via ACTION_TAG_DISCOVERED , and only gives access to NDEF messages via the EXTRA_NDEF_MESSAGES extra. No other tag properties or I/O operations are accessible. (2.3.3 - 2.3.4 Gingerbread MR1) - API level 10 includes comprehensive reader/writer support as well as foreground NDEF pushing (4.0 - 4.0.2 Ice Cream Sandwich) - API level 14 provides an easier way to push NDEF messages to other devices with Android Beam and extra convenience methods to create NDEF records. Lastly, you can optionally set : &lt;uses-feature android:name=&quot;android.hardware.nfc&quot; android:required=&quot;true&quot; /&gt; This means that only devices with NFC hardware can download your app from the app store, you may like to omit this if NFC isn&apos;t critical to your app
  • #17: Grab the intent, we need to see the intent that invoked our application, was it a launcher? Was it a tag? Check if the intent has the action of ACTION_NDEF_DISCOVERED, if its not, we ’ re not interested Get the ndef messages from the extras bundle and then begin to extract the payloads
  • #18: Use android studio, cutting edge IDE released during Google I/O 2013 (early access preview however) Create a new project via the wizard, may have to fiddle with setup values or move project around after creating in an empty directory Setup manifest: &lt;uses-permission android:name=&quot;android.permission.NFC&quot; /&gt; (this should be put in by the project wizard) &lt;uses-sdk android:minSdkVersion=&quot;10&quot;/&gt; Deploy app to device Scan a tag Notice how it displays the activity chooser - This is a massive NOOB ERROR and completely goes against the principle of simplicity for NFC Create an activity to handle plain text tags Add this into manifest &lt;activity android:name=&quot;com.mobdevcon.nfckickstarter.PlainTextTagReader&quot;&gt; &lt;intent-filter&gt; &lt;action android:name=&quot;android.nfc.action.NDEF_DISCOVERED&quot;/&gt; &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt; &lt;data android:mimeType=&quot;text/plain&quot;/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; Scan again and notice how the app now loads for a plain text tag Explain how the activity starts, then we check intent for action, then check extras and begin to decode the messages
  • #21: Same process for writing the tag as the plain text example Only different is the RTD
  • #23: Check if application is already installed by searching for package name If installed, invoke the application If not installed, direct to app on market place Excellent mechanism for promoting your app via tags (conferences etc) Embed an android application record into the ndef message
  • #24: Show how to use
  • #25: AAR working ok? That means you should have ZXing, great, now bookmark this to read on the train home later : Youtube google i/o video
  • #26: Beaming is basically Peer to peer NFC, which was introduced in Ice cream sandwich. Used for exchange of data between android devices Very useful for exchanging data between the same application running on multiple devices, such as sharing contacts and urls. The application receiving the beam must be in the foreground, and the device not locked When the devices come in close contact, the “ touch to beam ” ui is displayed Relatively simple to use in comparison to existing NFC topics we ’ ve covered
  • #27: Avoid the intent chooser, the idea of nfc is to be quick and seamless Write protect tags where possible to prevent hijacking Rule of thumb, i/o should not be on the main thread! Use wrapper libraries such as Ndef tools to avoid using such low level APIs.
  • #29: at work Put an nfc on your laptop, that enables silent mode, turns on wifi In the car Put an nfc sticker on the dash, enables GPS and bluetooth In your wallet Run out of business cards? Ready made vCard good to go In the gym Create an nfc keyring that enables airplane mode and starts your favourite playlist
  • #30: You’re probably all thinking “where can I get some tags from”? We’ve bought from rapid nfc and have found them to be good (disclaimer, we’re not connected with RapidNfc in any way, just found them to be a good place to get tags from!) http://rapidnfc.com/ Feel free to take away the place mats for your own use too.