Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Using Wifi-Direct and Proximity API for peer file transfers

In our first Hardware Friday post of the year, we're going to highlight a project from Stéphanie Hertrich that might help you write code that leverages hardware you might already have...

WinRT : Transfering a file between 2 peers using Wifi-Direct and Proximity API

On Windows 8.1 and WinRT, Wifi-direct enables wireless direct communication scenarios between devices executing the same application. That means you can exchange data between peers in areas without any internet network connectivity. All you need is a device that supports Wifi-Direct technology (Surface RT does, as well as most Windows 8 devices). This is complementary to the Share charm functionnality which helps sharing data between 2 apps on the same machine. Here you will share stuff on different machines that are executing the same app.

Wifi-direct can be a good alternative to NFC for some scenarios : you don’t need any NFC hardware but still can communicate between several close peers without network connectivity. If ever you want to test NFC but you don’t have the appropriate hardware, I wrote an article explaining how to install an NFC simulator driver on Windows 8.1 : Windows 8.1 : How to use Near-Field Proximity API without NFC hardware.

Wifi-direct communication is made possible thanks to the Proximity API (just like NFC does, but with different scenarios).

Here is a small lib providing the Wifi-direct file transfer fonctionnality and its sample demo application so that you can test it.

...

In this article, you will find:

  • how to use the lib and the sample app
  • behind the scene : how the Proximity API handles Wifi-direct
  • more possibilities for Wifi-direct scenarios

image

...

Sender

- Start browsing for other peers (Start)

- Send a file to a peer (ConnectAndSendFileAsync)

Receiver

- Register to the ConnectionRequested event

- Start listening to other peers (Start)

- Receive and save a file once a peer connected to you (ReceiveFileAsync)

...

image

...

image

...

More possibilities with the Proximity API

Other scenarios are available, like listening to any proximity event occuring (with PeerFinder.CreateWatcher) or providing an early access to peer’s data during the accept phase. It can be useful to help decide how to handle the peer that is trying to connect or if it should accept the connection or not.

She makes it look pretty easy, doesn't she? Hopefully you're now thinking about how cool you can make the sharing in your app's...

Tags:

Follow the Discussion

  • Greg Duncangduncan411 It's amazing what a professional photographer can do...

    @nana kobina: That would be great. If you post your project on a site like Codeplex, Github, CodeProject let us know (via the Contact Us). In the mean time, I've removed your comment (since it had your complete and un-obfuscated email address) to avoid you getting any spam, etc.

  • nana kobinanana kobina

    alright sir ,i will do exactly that.
    thanks so much.realy appreciate.

  • Doug FriskDoug Frisk

    The sample looks good, but like every other Wifi Direct/proximity sample I've tried it fails with "The wireless local area network interface is powered down and doesn't support the requested operation. (Exception from HRESULT: 0x80342002)" when the call to PeerFinder.FindAllPeersAsync is made on my Surface RT.

    It sounds like this is an issue with the Surface RT/Pro as documented here: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/5d3bf300-6a20-45e1-81fc-66b5e2e6cdd6/peerfinderfindallpeersasync-causing-error-the-wireless-local-area-network-interface-is-powered?forum=winappswithcsharp

    Is there something that needs to be configured on the surface to make this work?

Remove this comment

Remove this thread

close

Comment on the Post

Already have a Channel 9 account? Please sign in