software you can take with you

how to receive multi file from mobile with bluetooth inTheHand

Last post 12-28-2011 4:16 AM by alanjmcf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-22-2011 1:54 PM

    • rshnm
    • Not Ranked
    • Joined on 12-22-2011
    • Posts 1

    how to receive multi file from mobile with bluetooth inTheHand

    Hello

    I am developer of an application that use inthehand for connecting with mobile and send file from mobile to computer via bluetooth.

    I succeed to send one file from mobile to my pc and save it to Hard disk by the below code:

     

    public windowBlueToothReciver(params object[ parameters)

    {

    InitializeComponent();

    bluetoothListener = new ObexListener(ObexTransport.Bluetooth);

    bluetoothListener.Start();

    blutoothThread = new Thread(DealWithRequest);

    blutoothThread.Start();

    }

     

    public void DealWithRequest()

    {

    while (bluetoothListener.IsListening)

    {

         try

         {

              ObexListenerContext olc = bluetoothListener.GetContext();

              ObexListenerRequest olr = olc.Request;

              string filePath = Uri.UnescapeDataString(olr.RawUrl.TrimStart(new char[ { '/' }));

              olr.WriteFile(filePath);

         }

        catch (Exception ex)

        {

          break;

        }

      }

    }

    Now, some mobile users may select multi file and send them all together with bluetooth to my pc.

    In this case the above code has error and not able to save all of files transfered to my pc.

    Please help me to receive all of multi file that transfered by bluetooth.

    Thank you all.

  • 12-28-2011 4:16 AM In reply to

    Re: how to receive multi file from mobile with bluetooth inTheHand

    That isn't supported by 32feet.NET's ObexListener.  You could use Andy's Brecham.Obex with his example server code, see http://inthehand.co.uk/files/folders/objectexchange/entry9942.aspx

    Otherwise support for keeping the connection open and receiving another object could be added to ObexListener, download the sources from Codeplex and have a play... :-)  (Unit-tests work well for this sort of thing.)

Page 1 of 1 (2 items)
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting