1. Connect with
the real world
A hands-on tech session explaining the possibilities of
using PhoneGap, HTML5, Maps, NFC sensors all
together on your Windows Phone 8
Willy Riechert 5th April 2013
2. Table of content
• Introduction
• Simplest use case
• PhoneGap / Supported sensors
• PhoneGap NFC Plugin
• NFC Near Field Communication
• HERE Mobile HTML5 Framework
• Demo geoNFC app
• What to remember
• Q&A
2
3. Introduction
about me
• B.Eng. Geoinformation
Beuth University of Applied Sciences
• Student trainee at nokia Location & Commerce
• First experience with android development
Later on mobile web development
• Case studies on indoor positioning using wifi & NFC
What can you expect?
See an easy example of using WP and PhoneGap with integration of sensor
technologies(NFC)
3
4. ?
!
User wants NFC
to know where
(s)he is
Simplest use case
5. PhoneGap
• Easily create apps using
the web technologies you
know and love: HTML5,
CSS3 and JavaScript
• Open source solution for
building cross-platform
mobile apps
mh5.js nfc.js
• App run as a native
application within a
UIWebView
5
6. Supported
sensors
• It gets access to API
device features & browser
• Commodity sensors are
covered already
• Yet not supported sensors
are humidity & temperature
• Special sensors like NFC
are indirectly covered by
plugins…
6
7. PhoneGap NFC
Plugin
• Takes advantage of inbuilt
NFC capabilities
• Supported Platforms:
Android,BlackBerry7&10,
WP8
• Reader example for WP8
(solution.sln)
• github.com/chariotsolutions Methods WP8
/phonegap-nfc nfc.addNdefListener
• But what is NFC… nfc.write
nfc.share
7
8. NFC
Near Field
Communication
• Operates at 13,25MHz
band
• Save up to 8kBytes (2013)
• Transfer data rate
424kBit/s
• Data exchange over short
distance ~4cm
nfc-forum.org
• Give me one example…
8
10. HERE
Mobile HTML5
Framework
• It`s a JavaScript framework
for creation location-based
mobile web apps
• Benefits from
maps, search, routing, and
places services
• Easy to start, rich UI
components
• Combines it with jQuery
Mobile or other libraries
m.here.com
10
12. What to remember
PhoneGap Mobile HTML5 Framework NFC
• Try out what sensors and features • Obtain your own developer API • On WP tags must be NDEF
are supported on WP key on developer.here.com formatted
• Look at PhoneGap NFC Plugin on • Experience the full potential at • Metadata can not be read on WP
GitHub: m.here.com • Be aware how to build tags
github.com/chariotsolutions/phone - observe the sequence of records
gap-nfc - choose the correct identifiers
• Produce cross platform tags
12
Interested in something new. Alternative development on your WP.Use an commonknownlanguageGetthemost out of web-technologies tobuild mobile applicationsWhat can you expect?See an easy example of using WP and PhoneGap with integration of sensor technologies(NFC)
Positionsbestimmung – Nicht neu! Gelöst!! Draußen mir GPS, Wifi, TriangualtionsverfahrenWas ist so besonders an NFC? ->
Man kann PhoneGap für apps benutzen, die kostenlos, kommerziell oder open source sind. Beliebige Kombinationen davon sind ebenfalls möglich. Cross platform deployment is the target
Nfc.share Teilt eine NDEF Message via peer-to-peer
Historischer Ursprung: (RFID) ~1937IFF(Identifyfriendorfoe) Freund-Feind-Erkennung in Flugzeugen im 2.Weltkrieg (basierend auf Sichtkontakt - geringe Reichweite)Zeitgleich von United States & UK entwickeltSpecs:internationaler Übertragungsstandardkontaktloser Austausch von Daten(Funk)Besteht aus Speicherchip und AntenneFirmen NXP Semiconductors, Sony und Nokia gründeten 2004 gemeinsam das NFC-ForumImwiki steht ~10cm drin! Naja habe ich noch nicht erreichtAnwendungsgebiete:- Bezahlung MensaCard- Eintrittskarten/Zugangskontrolle- Touch&Travel/Mautsystem- SkipassWas gibt es für Gründe seine Position mit einem NFC tag zu bestimmen:Sehr genau Zellen, kleiner als Wifi Positioning und GPS
geo:URI wurde definiert durch die Internet Engineering Task Force.Publiziert am 8 Juni 2010WGS84 EPSG:4326Beispiel Tag Amit NDEF Record Type= „U“ Description: URIBeispiel Bmit NDEF Record Type= „Sp“ Description: Smart PosterURI Uniform Resource IdentifierURL Uniform Resource Locator (Spezialform einer URI)urn:nfc:wkt:Sp Full URI ReferenceRDT Record Type DescriptionTNF Type Name Formate 3-bit z.B. TNF_WELL_KNOWNNDEF NFC Data Exchange Format lightweightbinaryformatNDEF message beinhaltet einen oder mehrere NDEF recordsNDEF record beinhaltet einen payload, dieser wird beschrieben durch den Typ, der Länge und einem Identifier[optional]Howtolaunch APP:Wichtiger Bestandteil der App für Entwickler. Dazu Beispiele URI Schemes.Leider wurde dies nicht beim NFC Forum spezifiziert!! Jeder Hersteller hat eigene Lösungen.Windows: LaunchApp NDEF record windows.com/LaunchAppappID (absolute URI)Android: Android ApplicationRecord (AAR) de.beuth.borisPacketnameWie sollte ein Cross-PlatformLaunchApp Tag aussehen?NDEF Message: 1. LaunchApp(Win) 2. Custom(Symbian) 3. Generic URL 4. AAR(Android)Was ist nun der Nachteil an der URI geo:…?Andere Apps können ebenfalls auf die selbe URI „höhren“ und Starten!!! Eindeutig nur mit LaunchApp oder AAR Record
Erstelle eingene Location Based Apps!!Kombination möglich mit anderen Frameworks wie jQuery Mobile, Lungo(nicht WP) oder Sencha TouchUmfangreiche Anpassungsmöglichkeitenmöglichkeiten z.B. mapshemes, styling und icons, wie Farbe ändern! MH5 supports the following platforms:iOS 4.3+Android 2.2+MeegoBlackberry Touch devices OS6, OS7 (experimental)Windows Phone 8.0 (experimental)
Hiersieht man die AppGibtes nun auchim StoreSchautschonsehr native aus. Dank jQuery mobile mit WP8 Theme. Sehreinfachzuinstallieren. ImPrinzipnureineZeile code in der “Packet-Manager-Console” und einBeispielwirderzeugt. [Nuget package]>install-package jQMThemeForWindowsPhone8; GibtesalsLite und Full!MOTIVATIONNEW: Chooselocation on mapandwritelat/lon on tag!!!
Nütlziches Tool für Web-Developer:Um eineeinfachere Web-Entwicklungmit Visual Studio zuermöglichen, gibteswebEssensials! Ist gut für Syntax highlighting, Formatierunge, Class-Vorschläge
MeineProblemebeimProgrammieren:NFC-Plugin bereitetbeimschreibennochProbleme. App stürzt ab.SchwereinSmartPosterzuschreiben, da man den ganzgenauenAufbau von NDEF verstehen muss. Byte Reihenfolge muss eingehaltenwerden.Eswerdenstandardgemäß Text, URL, Empty und Media Record angebotenvom PluginIE kanneineHürdedarstellen.jQueryAnimationensindnicht 100%ig flüssigMeineBedenkenzu NFC:KannSicherheitsrisikodarstellen!SchenllesunsichbaresLesenistmöglich!SchonrechtkomplizierteTechnik an fürsich. (Grundschülerkannesnichterklären)