software you can take with you

Transfer all pictures from bluetooth device to PC by a button click.

Last post 07-31-2009 1:03 PM by omarszbz. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 03-26-2009 8:39 AM

    Transfer all pictures from bluetooth device to PC by a button click.

    Hello Guys,

    I am new to Bluetooth programming. I have found and build some great examples, which helped me a lot. But I couldn't find any resources related to my issue.

    My issue:

    1. I want to make a form with a button.

    2. When the button is pressed, I want my PC to initiate a bluetooth connection with my device.

    3. And transfer all the pictures from my device to my PC.

    This should all happen by a click of a button.

    Thanks in advance.

     Shy

  • 03-26-2009 12:34 PM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    What kind of device is it?

    If it supports the OBEX FTP profile you can use the Brecham Obex library to perform GET requests to retrieve files from the device.

    If the device is a Windows CE device you could write a custom application for the device using the .NETCF build of this library which listens on a custom service for the desktop request and then responds with the picture data.

    Peter

  • 03-27-2009 6:47 AM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    At the moment I am testing with an iPhone 3G with iBlutooth installed and a Nokia 6500.

    I am able to transfer data to both phones with the InTheHand library.

    I have tried the GetFolderListings example from the Becham OBEX FTP library but I keep getting the next error on the iPhone 3g:

    Connect failed with TimedOut "A connection attempt failed because the connected
    party did not properly respond after a period of time, or established connection
     failed because connected host has failed to respond 0023DF3946F5:00001106000010
    00800000805f9b34fb"

    With the Nokia 6500 I can now browse through the folder listing, but I cann't do any get operations. See image.

    Do you see what I am doing wrong?

     

     

     

  • 03-27-2009 11:35 AM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    The Nokia case is working! :-)  Using "n <filename>" is command you want to use.  The error is just reporting that since it is a binary file it can't display it on screen.  If you look on your local disk you'll find that Afb000.jpg has been successfully written there. :-)  BTW the FolderExplorer app will show you the remote server but with a WinForms UI, double-clicking a file will download it.


    In the iPhone case.  The _seems_ to report that the device is not in range.  Presumably it was... 
    Do we know if it supports OBEX FTP?  A quick search of the internet suggests not.

    If you want to double-check...  If you have a download of the 32feet.NET library can you run the SdpBrowserXxxx app and see what it reports when you hit the <All Services over L2CAP> button for the iPhone.  (IIRC a file was unfortunately missed from the most recent (2.3) release, so you have to download this sample again at http://32feet.net/files/folders/samples/entry6096.aspx).

  • 03-30-2009 3:40 AM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    Here is a sample application that allows to browse throught mobile phone and download files.Obexplorer

    If you want to download all images you will need to browse recursively through all folders on the mobile device.

  • 04-02-2009 7:30 AM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    This is exactly what I needed: an excellent example with source code.

    I have hacked a test application, which can get all the files from a specified folder of the Nokia 6500.

    When I have something shareable I will post it here.

    Thanks guys!

  • 04-08-2009 4:05 AM In reply to

    • Friso
    • Not Ranked
    • Joined on 04-07-2009
    • Posts 2

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    I also want to download all the images from a certain folder from my mobile device (Nokia n95)

    Yet, I tried the obexeplorer and it is working great! But the obexeplorer uses dialog screens, which I can't use for my application...

    It is possible to get the folder listing from my n95 with the following code:

    BluetoothClient bc = new BluetoothClient();

    BluetoothDeviceInfo[ o = bc.DiscoverDevices();

    for (int i = 0; i < o.Length; i++)

    {

    if (((InTheHand.Net.Sockets.BluetoothDeviceInfo[)(o))Idea.DeviceName == "Onbekend apparaat")

    {

    BluetoothDeviceInfo selecteddevice = ((InTheHand.Net.Sockets.BluetoothDeviceInfo[)(o))Idea;

    BluetoothEndPoint remoteEndPoint = new BluetoothEndPoint(selecteddevice.DeviceAddress,

    BluetoothService.ObexFileTransfer);client = new BluetoothClient();

    client.Connect(remoteEndPoint);

    session = new ObexClientSession(client.GetStream(), UInt16.MaxValue);

    session.Connect(ObexConstant.Target.FolderBrowsing);session.SetPath(@"E:\Images\" + DateTime.Now.ToString("yyyyMM") + @"\" + DateTime.Now.ToString("yyyyMM") + @"A0\" );

     

    Stream xmlStrm = session.Get(null, ObexConstant.Type.FolderListing);

    ObexFolderListingParser parser = new ObexFolderListingParser(xmlStrm);

    parser.IgnoreBadDateFormats =

    parser.IgnoreUnknownAttributeNames =
    true;ObexFolderListing listing = parser.GetAllItems();

     

     

     

    foreach (ObexFileItem file in listing.Files)

    {

    // read file information

    }

    }

    }

    Ok, this code works fine for me, it shows some images located in the N95 image folder. But I don't know how to get the .jpg images located there. I've read that it can be done with a obexwebrequest, pushobject, or with a session.Getto() etc, etc. Now I'm a bit confused. Can someone help get me back on track? Or does someone have a working code snippet for a nokia N-series phone.

  • 04-08-2009 6:52 AM In reply to

    • Friso
    • Not Ranked
    • Joined on 04-07-2009
    • Posts 2

    Re: Transfer all pictures from bluetooth device to PC by a button click.

    Nevermind, got it already.

     

  • 07-31-2009 1:03 PM In reply to

    Re: Transfer all pictures from bluetooth device to PC by a button click.

     Hi Friso!!

     

    Do you want tell us how you got it???  Thank you

     

    Kind regards from Mexico City

     


     

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