here  i am trying to send a file over bluetooth but its not sending any
data.
here the main problem is that its not sending or receiving any data over
the two devices but they are connected to each other.

<on configuring the bluetooth chat example.>


Sending code:


     File myFile = new File(message.toURI());
     Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);
     System.out.println(nosofpackets);
     BufferedInputStream bis= new BufferedInputStream(new
FileInputStream(myFile));
     byte[] send = new byte[4096];
     for(double i=0; i<nosofpackets; i++)
     {
          send = null ;
          a=bis.read(send, 0,send.length);
          Log.d("BluetoothChat", "data packet " + i);
          if(a==-1)
          {
              break;
          }
          mChatService.write(send);
     }


Receiving code :


    while((bytes = mmInStream.read(buffer))>0)
    {

    Log.d(TAG, "data is there for writing");
    bos.write(buffer);

    }

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to