29
DEVELOPING NFC APPS IN WINDOWS PHONE 8 Andreas Jakl [@mopius] Mopius LUMIA APP LABS #8

LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

Embed Size (px)

Citation preview

Page 1: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

DEVELOPING NFC APPS IN WINDOWS PHONE 8 Andreas Jakl [@mopius] Mopius

LUMIA APP LABS #8

Page 2: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

− NFC intro

− Share captured photos

− Share URLs

− Share your app − Custom URI scheme

− LaunchApp tag

− Storing data on NFC tags

− Multi-user collaboration

− Tools & resources

AGENDA

2

Page 3: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

3

TAP AND DO

A gesture that is a natural interaction between people in close proximity used to trigger doing something together between the devices they are holding.

System: Near Field Proximity (e.g., NFC)

Documentation: bit.ly/ProximitySpec

Page 4: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

4

SCENARIOS

Connect Devices Exchange Digital Objects Acquire Content

Page 5: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

5

Prox

imit

y AP

Is

Win

dow

s Ph

one

8 +

W

indo

ws

8 Documentation

Win8: bit.ly/ProximityAPI WP8: bit.ly/ProximityAPIwp8

ASUS VivoTab RT LTE

Page 6: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

6

SHARE CAPTURED PHOTOS

Page 7: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

7

SHARE CAPTURED PHOTOS

1. Take

picture

2. Share

captured file

CameraCaptureTask ShareMediaTask

Code Demo

Page 8: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

8

SHARE URLS

Page 9: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

NDEF Message

9

NFC DATA

NDEF Record (e.g., URL)

NDEF = NFC Data Exchange Format

Page 10: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

10

NDEF.CODEPLEX.COM

Reusable NDEF

classes

Create NDEF messages & records

(standard compliant)

Parse information from raw byte arrays

Fully documented Open Source LGPL license

(based on Qt Mobility)

NDEF messages are standardized by the NFC Forum: http://www.nfc-forum.org/specs/

Page 11: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

11

SUPPORTED RECORD TYPES

Smart Poster URI

Text LaunchApp

Android Application Record (AAR) Windows Phone Settings

Nokia Accessories Record NearSpeak Voice Messages

Geo tags Social tags SMS tags Telephone call Mailto tags

Page 12: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

12

SHARE URLS

Code Demo

Page 13: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

13

Page 14: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

14

SHARE YOUR APP

Page 15: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

15

CUSTOM URI SCHEME

nearspeak: en-USmGood+morning. Custom data

Protocol name

Encoded Launch URI

Examples* skype:mopius?call

nokia-music://show/artist/?name=Rihanna

* Definition & examples: http://en.wikipedia.org/wiki/URI_scheme

Page 16: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

16

CUSTOM URI SCHEME

… from NFC tags

… on other devices

… from other apps

(same device)

Launch your app ...

Code Demo

Page 17: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

17

USER EXPERIENCE

No app installed 1 app installed 2+ apps installed

Page 18: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

18

LAUNCHING APPS

Tag / phone launches app through custom URI scheme

Tag directly contains app name and parameters

Page 19: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

19

CUSTOM URIS VS. LAUNCHAPP

Use less space on tag (LaunchApp with multiple app ids: big!)

Better cross-platform compatibility (also Android apps can be launched with custom URI)

No unique app mapping (other apps can register for your URI scheme too!)

Page 20: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

Recommended

20

STORING APP DATA ON NFC TAGS

HTTP Website

Link

Safest and most cross-platform

Custom URI Scheme

Better UX for app launching

LaunchApp Tag

Best app launching UX, but specific

to Windows

Windows Protocol

Should not be used for storing

custom data

External Type

Standardized type for storing data, but limited use on Windows

bit.ly/NfcAppData

Page 21: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

21

MULTI-USER COLLABORATION

Page 22: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

Tap for

22

MULTI-USER COLLABORATION

Quick Data Exchange

ProximityDevice Exchange Windows /

NDEF messages, SNEP protocol

Long Term Connection

PeerFinder Automatically builds

Bt / WiFi Direct socket connection

Page 23: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

23

ESTABLISHING

Long Term Connection

Trigger

Interact with Tap NFC

Browse

Start Search Bt, WiFi, etc.

Page 24: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

24

TAP TO TRIGGER

App not installed

App installed

Page 25: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

25

CONNECTION STATE

PeerFound

1 Proximity gesture complete Devices can be pulled away

Connecting / Listening

2 Which device initiated tap gesture? → Connecting, other device Listening

Completed

3 Access socket of persistent transport

(e.g., TCP/IP, Bt)

Page 26: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

26

NFCRPS Multiplayer game

Tap launches app

on 2nd phone

Players decide next move on

own device

Both see the winner! Code Demo

Page 27: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

27

TOOLS & RESOURCES

Page 28: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

− NFC Overview: developer.nokia.com/NFC

− MSDN Proximity API documentation: bit.ly/ProximityAPIwp8

− NFC News: nfcworld.com

− NDEF Library for Proximity APIs: ndef.codeplex.com

− NFC developer comparison (WP, Android, BlackBerry): bit.ly/NfcDevCompare

− Specifications: nfc-forum.org

TOOLS AND RESOURCES

28

Page 29: LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8

29

Thank you! Andreas Jakl [@mopius]

nfcinteractor.com

Code examples online: bit.ly/NfcWebinar