Sharing Images with Other Devices Using NFC or with Other Registered Phone Services

New to the Windows Phone 8 SDK is the ShareMediaTask, which allows you to pass an image to another device via NFC, or to another person using the phone’s messaging app, or with another registered service on the phone such as OneNote.

To launch the ShareMediaTask, create a new instance of the task and set its FilePath property to the location of a file on the device, as shown:

ShareMediaTask shareMediaTask = new ShareMediaTask();shareMediaTask.FilePath = fileName;shareMediaTask.Show();

The ShareMediaTask works well in conjunction with other tasks, in particular the CameraCaptureTask and the PhotoChooserTask. This is demonstrated in ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.