File transfer via Bluetooth, for example, in the example of Bluetooth Bluetooth Chat

How to use the example bluetooth bluetooth chat and chaneg to transfer files. I want to transfer the local SQLite database to another Android device via Bluetooth.

I changed the example code (http://developer.android.com/resources/samples/BluetoothChat/index.html), but if I send a file larger than 1024 bytes, then I get more events triggered in the Handler class, I tried to send a small txt file and it works (less than 1k).

Can someone help me.

Thanks Toni

+4
source share
1 answer

The buffer reading in this example is set to 1024 bytes. After each reading, the length of which does not exceed 1024 bytes, it sends a message to the handler.

http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.html

(search in 1024)

+2
source

All Articles