automating your life: a look at nfc

31
Automating Your Life A look at NFC and BLE

Upload: mitchell-muenster

Post on 28-May-2015

395 views

Category:

Technology


4 download

DESCRIPTION

Talk for Snow*Mobile (now Madison+Mobile) on NFC. this was the full NFC part before it was reduced for the compressed timeframe.

TRANSCRIPT

Page 1: Automating Your Life: A look at NFC

Automating Your Life

A look at NFC and BLE

Page 2: Automating Your Life: A look at NFC

Mitch “Rez” Muenster

Page 3: Automating Your Life: A look at NFC

Mobile Developer

Page 4: Automating Your Life: A look at NFC
Page 5: Automating Your Life: A look at NFC
Page 6: Automating Your Life: A look at NFC
Page 7: Automating Your Life: A look at NFC
Page 8: Automating Your Life: A look at NFC
Page 9: Automating Your Life: A look at NFC

Grinder

Page 10: Automating Your Life: A look at NFC

What is a Grinder?

Grinders are do it your self cyborgs (people) that are upgrading their bodies with hardware, without waiting for corporate product development cycles or authorities to say it is okay.

Page 11: Automating Your Life: A look at NFC

Implanting:

• Implant itself is rather small. !

• Implanting is done at your own risk

!• Location is everything.

Page 12: Automating Your Life: A look at NFC

Risks involved as a Ginder

If you dod decide to modify your self. be sure you know what you are doing. be safe.

Seeking out someone trained in body modification is strongly advised.

We are all adults and grown ups, if you do modify your body, you do so at your own risk.

Page 13: Automating Your Life: A look at NFC
Page 14: Automating Your Life: A look at NFC

Grinders and mobile Development

With an NFC or RFID implant you can use your body to unlock the phone without unlocking the phone. Helps make your phone more secure.

Integrate it with apps developed for vehicles to provide hands free access to your car, or motorcycle.

Enable the use of the tag scan as the “enter” or “okay” button rather then a touch.

And so much more.

Page 15: Automating Your Life: A look at NFC

NFC

What is it and how is it used

Page 16: Automating Your Life: A look at NFC

NFC (Near Field Communication)

!

An evolved from of RFID

!

Provides contact-less data transfer and power usage.

What Is NFC

Page 17: Automating Your Life: A look at NFC

Misconceptions

Page 18: Automating Your Life: A look at NFC

Misconceptions

RFID and NFC does not work how Hollywood portrays it.

You cannot be tracked with the implant like a GPS. (range is only a few inches)

RFID, NFC or implanting is not evil (if it is then most shipping companies, and stores you shop at are too for using this tech)

There is no battery or power supply in an RFID tag. Your body parts will not explode dissolve from using a implant.

A few implants will not make you a member of the Borg.

Page 19: Automating Your Life: A look at NFC

Types of NFC

NfcA (ISO 14443-3A)

NfcB (ISO 14443-3B)

NfcF (JIS 6319-4)

NfcV (ISO 15693)

IsoDep (ISO 14443-4)

Ndef

MIFARE Classic

MIFARE Ultralight

• Ultralight – 48 bytes / 46 Useable • Ultralight C* – 128 bytes / 137 Useable • NTAG203 – 144 bytes / 137 Useable • Mifare 1k *– 1,024 bytes / 716 Useable • Desfire 4k* – 4,112 bytes / 4,094 Useable • Topaz 512 – 512 bytes / 454 Useable • NTAG210 – 48 bytes / 46 Useable • NTAG210 – 144 bytes / 137 Useable

NFC FORMATS Popular NFC Tags & Memory Sizes

* Contains Secure Element

Page 20: Automating Your Life: A look at NFC

How it works

NFC Enabled device sends power to tag

Operating frequency of 13.56 MHz

Data transfer of 106 kbit/s

Operating distance up to 100 mm (depending on various parameters as e.g. field strength and antenna geometry)

Page 21: Automating Your Life: A look at NFC

What Happens when a tag is detected?

Tag is analyzed

Categorize the data.

Parse it to figure out the mime type or URI payload

Start application that is interested in the categorized data.

Page 22: Automating Your Life: A look at NFC

Tag read life cycle

Page 23: Automating Your Life: A look at NFC

Demo time!

Page 24: Automating Your Life: A look at NFC

Enable NFC in your app

1. Request permission to use NFC hardware

<uses-permission android:name=“android.permission.NFC” />

2. Set SDK Level

<uses-sdk android:minSDKVersion=“10”/>

3. Set uses feature so app only shows on Google Play if the Device has NFC Hardware

Not required but curious for the user who is downloading the app.

<uses-feature android:name=“android.hardware.nfc” android:required=“true”/>

Page 25: Automating Your Life: A look at NFC

Reading a plan text tag

1. Grab the intent

2. Check if action is ACTION_NDEF_DISCOVERED

3. Get EXTRA_NDEF_MESSAGES from the extras bundle

4. Extract the payloads from the NdefRecords

Page 26: Automating Your Life: A look at NFC

Writing a Tag

public NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {    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);    NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN,    NdefRecord.RTD_TEXT, new byte[0], data);    return record;}

Page 27: Automating Your Life: A look at NFC

Manually creating the NdefRecord

byte[] uriField = "example.com".getBytes(Charset.forName("US-ASCII")); byte[] payload = new byte[uriField.length + 1];              //add 1 for the URI Prefix byte payload[0] = 0x01;                                      //prefixes http://www. to the URI System.arraycopy(uriField, 0, payload, 1, uriField.length);  //appends URI to payload NdefRecord rtdUriRecord = new NdefRecord(     NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_URI, new byte[0], payload);

Page 28: Automating Your Life: A look at NFC

Uses for NFC

SMART Advertisements

Mobile payments

File Sharing

Goods and device authentication

Call requests

SMS

Call to Action

Bluetooth or Wi-Fi pairing

Connection handover

Authentication tags

Business cards

Page 29: Automating Your Life: A look at NFC

Out of the box NFC uses

Light switch

Use an NFC tag as a on of proxy for someone with a Philips Hue light bulb

(POE) Power Over Ethernet

Use an NFC tag as a proxy for sending a POE packet to your computer

NFC enabled rings to provide the same functionality as listed above

Bio Hacking, chipping or grinders

Imbedding an NFC chip in the body to open doors, turn on lights and all of the previously mentioned uses.

http://www.youtube.com/watch?v=o4caxH5_Pe4

Using phones as race cars

http://www.youtube.com/watch?v=c6ATOgEcR1U

Page 30: Automating Your Life: A look at NFC

More info and demos

http://developer.android.com/guide/topics/connectivity/nfc/nfc.htmlD

http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html

http://www.dangerousthings.com

Page 31: Automating Your Life: A look at NFC

@MobileRez - Twitter

Thank You

Any questions, see me after talk.