.NET Components for Mobility

Sending files from PC to mobiles problems

Last post 07-03-2010 8:32 AM by galsan. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 07-03-2010 8:32 AM

    • galsan
    • Not Ranked
    • Joined on 05-26-2010
    • Posts 1

    Sending files from PC to mobiles problems

    Hi, I`m developing a file sending application from PC to mobiles. I`m using Brecham OBEX with Object Push service. Everything works fine, but there are some problems. For example when I make test with LG GT505 it works without any intervention from the PC bluetooth driver or Windows, everything starts and ends up in my application. But when I eg. use LG KP501 I`m having some confirmations to pass on mobile and on PC, when I agree Virtual Com Port is installed. I can`t deal with this because my application must be fully automatic. Do you have any ideas what can I do to avoid this? The second problem I have is that even I always use a disconecting methods for obex session as well as for client connection, mobiles not always disconect properly and I dont know why.. (?) I show some code:
              BluetoothClient client = new BluetoothClient();
              ObexClientSession ObxSession = null;
    
               try
               {
                   client.Connect(BtDev.DeviceAddress, BluetoothService.ObexObjectPush);
               if (client.Connected)
                   Console.Write("polaczony\n");
               else
                   Console.Write("rozlaczony\n");
       
                ObxSession = new ObexClientSession(client.GetStream(), UInt16.MaxValue);
                ObxSession.Connect();
                  
                  file = new FileStream(args[1], FileMode.Open);
                  ObxSession.PutFrom(file, Path.GetFileName(args[1], null, file.Length);
                  file.Close();
    
                   
                   ObxSession.Disconnect();
                   client.Close();
                                                  
               }
               catch (Exception e)
               {
                   client.Close();
                   Console.Write(e.Message + '\n');
               } 
    
    Sorry for my english and pls for some tips ;)
Page 1 of 1 (1 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting