title: Windows .NET on PC send/receive files from Android phone o0ver Bluetooth
body: <p>I'm working on a project that requires a Windows application running on a desktop/laptop PC with Bluetooth to talk to an Android phone to share files.  I want to be able to get a file from the PC to the phone and from the phone to the PC.  It can be done through a send on both or a send/receive from either one.</p>
  
  <p>I'm working in .NET on the PC and either Android Studio or Xamarin (Visual Studio) on the Android phone.</p>
  
  <p>I've looked at the 32feet SDK's, and I can send a file from the PC with OBEX, but I'm forced to accept the file on the Android phone.  I'd like to send a file and either either put it in a directory on the phone or handle it manually in my code on the phone with some sort of receiver in Android.</p>
  
  <p>I'm writing both applications ... native phone app and Windows application.</p>
  
  <p>What I'd really love to do is some sort of shared directory on the phone.  Phone app writes to a particular directory on the phone.  PC polls that directory over Bluetooth and removes files from the directory when read.  PC application then writes files to that directory on the phone for the phone app to poll/read for.</p>
  
  <p>Any examples of something similar?  Or something that will help me accomplish this task?</p>
  
  <p>.......</p>
  
  <p>I'm seeing the downvotes ... here's some code I'm using to send a file to the phone.  I need to know how to accept this automatically with a receiver on the phone and write the file to disk on the phone...</p>
  
  <pre><code>Private Sub btnTestBeam1_Click(sender As Object, e As EventArgs) Handles btnTestBeam1.Click
  
      Dim sbdd As New InTheHand.Windows.Forms.SelectBluetoothDeviceDialog
      Dim ofdFileToBeam As New OpenFileDialog
      sbdd.ShowAuthenticated = True
      sbdd.ShowRemembered = True
      sbdd.ShowUnknown = True
  
      If sbdd.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
  
          If ofdFileToBeam.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
  
              Cursor.Current = Cursors.WaitCursor
              Dim theuri As New Uri("obex://" + sbdd.SelectedDevice.DeviceAddress.ToString() + "/" + System.IO.Path.GetFileName(ofdFileToBeam.FileName))
              Dim request As New ObexWebRequest(theuri)
              request.ReadFile(ofdFileToBeam.FileName)
  
              Dim response As ObexWebResponse = CType(request.GetResponse(), ObexWebResponse)
              MessageBox.Show(response.StatusCode.ToString())
              response.Close()
  
              Cursor.Current = Cursors.Default
          End If
  
      End If
  
  End Sub
  </code></pre>
  
  <p>What I'm looking for is the ability to write straight to a folder on the phone or how to receive the file with an app on the phone.</p>
  
  <p>And I also need to be able to do the same from the phone back to the PC..</p>
  
  <p>Any comments/suggestions would be helpful...</p>