开发者

Transfering files over bluetooth like in Android Bluetooth Chat Example

How to use Android Bluetooth Chat Example and chaneg it for file transfer. I want to transfer 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 file bigger than 1024 bytes long, then I get more events triggered in Handler class. I tried to send small txt file and it's working (smaller than 1k).

Can somebody help me please.

Thanks, Toni开发者_如何学运维


Read buffer in that example is set to 1024 bytes. After each read, which is max 1024 bytes long, it sends a message to the handler.

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

(search for 1024)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜