Since its first release on September 10th, the NDEF Library for Proximity APIs has established itself as a must-have library for NFC developers working on Windows 8 and/or Windows Phone 8.
After a thorough beta phase, today version 1.0 of NDEF Library has been released. In addition to the update, the download now also comes with the open source NdefDemo example app (GPL license) that demonstrates how to use the library in a Windows Phone 8 app!
Why an NDEF Library?
While the Windows Proximity APIs provide high-level support for some NFC use-cases, the NDEF library directly implements the standards as defined by the NFC Forum. It allows full control over messages, for use with NFC tags and in peer-to-peer scenarios (to send content between devices).
The NDEF library includes support for the basic NDEF constructs: messages and records. The standardized, well-known types URI, Text and Smart Poster are implemented.
On top of those classes, the library features many convenience classes that take care of parsing and formatting other frequently used and important NDEF records. These include: social networks, geo tags, LaunchApp, Android Application Record, SMS records and many more. For a full list, take a look at the project site!
All currently available major operating systems support NDEF standards: messages created by the library are be understood by Windows 8, Windows Phone 8, Android, BlackBerry, Symbian, MeeGo and others.
License, Documentation & Examples
The NDEF Library is available under the open source LGPL license, which essentially allows using the library also in closed-source, proprietary apps. Its code is fully documented according to doxygen standards; the download contains the docs as HTML.
In addition, a full source code example app (“NdefDemo“) is provided for Windows Phone 8 – it allows reading tags and parsing NDEF messages, as well as writing NDEF messages to tags and sending them to other devices. In addition, the example app also parses arguments it retrieves through LaunchApp NFC tags.
What’s New in 1.0?
There have been important improvements and enhancements since the last version. In addition to documentation improvements and minor code fixes, the major changes are:
- Added WpSettings records for launching Windows Phone 8 settings pages
- Added Mailto records for sending email messages
- Added DriveTo and WalkTo URI schemes to Geo tags for starting navigation on WP8
- Added Nokia Accessories record to easily launch apps on Nokia Lumia WP8 phones
- Added NearSpeak records for storing voice messages on tags
- URI encoding for body text of SMS messages
- Parameter to get the raw URI (as byte array) of Uri records
To integrate the NDEF Library with your project, use the NuGet package manager of Visual Studio 2012 – it will download, install and update the library with one click.
Make sure you update the NuGet extension in your Visual Studio to the latest version (2.1+) before installing the NDEF library, as older NuGet versions didn’t fully support portable class libraries that target both Windows 8 + Windows Phone 8.
You can also download the NDEF Library as a zip package, which is also the best way to get the NdefDemo example app code. In case you prefer the latest nightly code, you can also directly clone the project from the SVN server.
I’m planning to add several additional features to the NDEF library in the future – including Bluetooth and vCard (business card) support. To see the plans, vote on proposed features or even suggest own feature ideas, take a look at the project’s Issue Tracker.