Monday 1 April 2013

How to use emulators to develop NFC features on WP8

One of the more interesting features of Windows Phone 8 is its Proximity Framework for Near-field communications (NFC). Both Nokia and Microsoft have heavily invested in this area. The Proximity API provides you the controls needed to innovate on NFC technology, but at the moment Windows Phone SDK default emulator does not simulate NFC. That means you have to use real WP8 devices to test and debug NFC-related features. If you?re developing a feature to be used between NFC-enabled devices, you?ll need to have at least two devices in hand. In addition, there are often physical movements required to perform NFC interactions while debugging.



The good news is that there is an open source project called ?Proximity Tapper? (http://proximitytapper.codeplex.com/) which offers NFC simulation on top of the emulators WP8 SDK provides. The project is generously Apache 2.0 licensed. Proximity Tapper can simulate a wide variety of NFC scenarios, such as tapping one WP8 device with another, tapping a WP8 device with a tag, and tapping a WP8 device with Windows 8 device. The use cases that Proximity Tapper cannot perform include tag writing, ?Tap+Send? system integration (due to lack of Bluetooth capability), and Wallet integration. Also, it currently does not support tapping between a real WP8 device and an emulator. According to discussion on project webpage, mixing real WP8 device with emulator seems to be too much work.


From the Proximity Tapper UI, you first add devices. WP8 Emulators can be automatically discovered. Also other devices such as Windows 8 devices can be added manually using IP, hostname, or MAC addresses.


Proximity tapper UI


Once the devices are visible in the UI, you can connect devices to trigger further actions in the middle part of the UI. For example, you can highlight a device or devices, and then press ?Tap Selected devices and Remain Connected?. The connection will then be available in the connections panel.


Proximity sending a URL


After that, you can trigger NFC tapping events with desired content. In this next illustration, we demonstrate how it behaves by sending an URL to an emulator device. In Figure 3, we demonstrate how it behaves using PeerFinder API. For publishing any specific messages, you can specify the message type and message data.


proxmity_tapper_pair_devices


Proximity Tapper can be a pretty handy tool for NFC development on Windows Phone 8. It allows you to focus more on the content of messages to be published/subscribed. Using the emulator to test NFC is not only cost-efficient but also saves you the hassle of moving between real devices and keyboard while developing NFC features. It?s also perfect for demonstrating your app during presentations.


Do you have a favorite tool to speed development? Leave a comment and let us know.

crawled from : Nokia

No comments:

Post a Comment