Android Question Send data via Bluetooth

pgargom

Member
Licensed User
Longtime User
Hi Erel,
i have a doubt about use of Bluetooth.
i want to implement an app to send data to devices but implement only 1 side of the conection.
I use "serial1.Connect3(Address,11)" to connect with my device.
My question is, how i can to send a photo to the other devices when i am conected? Can i use syncstreams or not?

Thank you !!
 

pgargom

Member
Licensed User
Longtime User
Then, if im using the code of BTAutoPair (http://www.b4x.com/android/forum/threads/btautopair-programmatic-bluetooth-device-bonding.25675), and in the BtSerial_Connected event i put the next, it would be to send data to the other device?

B4X:
AStreams.Initialize(Null,BtSerial.OutputStream,"AStreams")
Dim buffer() As Byte
        buffer = "This is an example".GetBytes("UTF8")
        AStreams.Write(buffer)

Because i am using this code and i cant send data to other devices. However, if i use the example of BluetoothIntent ( http://www.b4x.com/android/forum/threads/send-text-file-using-bluetooth.35683/#content), i can send data to the other device, but i have to touch the tablet to select the device to send the data, and i want to send the data automatically, without touch the device.
What do you think about this? is this posibble?
thank you and sorry for the trouble.
 
Upvote 0

pgargom

Member
Licensed User
Longtime User
ok.. sorry.. my question is:

if the devices are paired and conected, how i can to do to send data to the device? Because i try to send data with the code of the third post, but the device dont receive nothing.
 
Upvote 0
Top