O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required