Proximity sample

This sample demonstrates how to use the PeerFinder, ProximityDevice, and PeerWatcher classes to communicate with nearby devices.

 
 
 
 
 
4.5 Star
(13)
36,262 times
Add to favorites
11/26/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • ProximityDevice.GetDefault() gets the exception
    4 Posts | Last post March 01, 2012
    • Hi, I use VS2011 11.0.50110.2 PREREL with Windows 8 x64 (8220) on Samaung tablet from Windows 8 2011 build.
      when I call ProximityDevice.GetDefault(), it gets the exception as the below,
      "Access is denied.
      WinRT information: The device interface provided is not valid: 
      \\?\acpi#nxp5440#2&daba3ff&1#{fb3842cd-9e2a-4f83-8fcc-4b0761139ae9}. 
      Please check that the device is properly installed."
      Could you tell me how can I check this exception?
      thank you.
    • Are you getting this exception when running the sample? You would typically only get an Access Denied error if your application manifest did not specify the 'Proximity' capability. The sample should have that capability declared.
    • Hi,
      I enabled 'Proximity' capability.  ProximityDevice.GetDefault() is work.
      I use DeviceArrived and DeviceDeparted of ProximityDevice class events, when I touch a Tag card, the event is got.
      but If I touch a Proximity Device(Android phone, and it is share a Tag), these two events can't be got.
      Does it normal?
      and PublishMessage(), does it work for publish a URL?
      thank you.
    • Regarding NFC interop with Android devices, I would have to suggest you look at the NFC interop documenation for your Android phone. Some standards for NFC interop are very new.
  • Exception from ProximityAPI
    2 Posts | Last post February 21, 2012
    • Hi,
      
      Using VS2011 11.0.50110.2 PREREL with Windows 8 x86 8220) - with any user(Administrator, user with administrator priv., Guest) - I get UnauthorizedAccessException when I call ProximityDevice.GetDefault() or PeerFinder.Start().
      In *all* cases Marshal.GetLastWin32Error() returns 0, and InnerException is *always* blank.
      
      Help anyone?
      Thanks,
      Niv
      
      1. When I try to call ProximityDevice.GetDefault() (with no parameters) I always get this exception:
      System.UnauthorizedAccessException was caught
        HResult=-2147024891
        Message=Access is denied.
        Source=""
        StackTrace:
             at Windows.Networking.Proximity.ProximityDevice.GetDefault()
             at MetroTestWithProximity.App.OnLaunched(LaunchActivatedEventArgs args) in c:\Users\Niv\Documents\Visual Studio 11\Projects\MetroTestWithProximity\MetroTestWithProximity\App.xaml.cs:line 50
      
      2. When I try to call PeerFinder.Start() (with no parameters) I always get this exception:
      System.UnauthorizedAccessException was unhandled by user code
        HResult=-2147024891
        Message=The parameter is incorrect.
        Source=""
        StackTrace:
             at Windows.Networking.Proximity.PeerFinder.Start()
             at MetroTestWithProximity.App.OnLaunched(LaunchActivatedEventArgs args) in c:\Users\Niv\Documents\Visual Studio 11\Projects\MetroTestWithProximity\MetroTestWithProximity\App.xaml.cs:line 45
      
      3. When I try to call PeerFinder.Start(<some string>) I always get this exception:
      System.UnauthorizedAccessException was unhandled by user code
        HResult=-2147024891
        Message=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
        Source=Windows.Networking.Proximity
        StackTrace:
             at Windows.Networking.Proximity.PeerFinder.Start(String peerMessage)
             at MetroTestWithProximity.App.OnLaunched(LaunchActivatedEventArgs args) in c:\Users\Niv\Documents\Visual Studio 11\Projects\MetroTestWithProximity\MetroTestWithProximity\App.xaml.cs:line 45
      
    • Are you getting this exception when running the sample? You would typically only get an Access Denied error if your application manifest did not specify the 'Proximity' capability. The sample should have that capability declared.
  • Missing C++ read/write StreamSocket example
    2 Posts | Last post November 16, 2011
    • The comment in MainPage.xaml.cpp says "// See the Windows.Networking.Sockets.StreamSocket sample for an example or read/writing to a StreamSocket" but no such sample in C++ exists.
      
      Can we please get a sample of how to handle a DataReader or DataWriter in C++ with a WebSocket? Particularly how to handle multiple messages in the new ASYNC context when C++.
      
      Much needed. Thanks,
      
      
    • Unfortunately there currently isn't a C++ sample for StreamSockets. Expect one to be made available in the coming months.
      You can see some code using DataReader/DataWriter in C++ in the File Access sample: http://code.msdn.microsoft.com/windowsapps/File-access-sample-d723e597
  • What is a Proximity Device??
    2 Posts | Last post November 16, 2011
    • I'm just echoing what Matthew has already asked. If we can get some clarification on that it would make this code 100 times more valuable... 
    • Proximity is a new device type in Windows 8. One of the primary proximity technologies expected to be supported in Windows 8 is Near-field communications (NFC). If you do not have one of the slate PCs given out at the //build conference, you probably don’t have a proximity device available. You can see more information about what you can do with proximity aware metro applications here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465229(v=VS.85).aspx
      For information on how to write a driver for a proximity device go here: http://msdn.microsoft.com/en-us/library/windows/hardware/hh439292(v=VS.85).aspx
      The sample proximity driver contained in the Windows 8 WDK can also serve as a simulator to enable proximity applications and experiences.
      
41 - 44 of 44 Items