在Android的蓝牙聊天实例Transfering通过蓝牙文件,如 [英] Transfering files over bluetooth like in Android Bluetooth Chat Example

查看:147
本文介绍了在Android的蓝牙聊天实例Transfering通过蓝牙文件,如的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Android的蓝牙聊天实例和chaneg它进行文件传输。我想通过蓝牙本地SQLite数据库转移到另一个Android设备。

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.

我改变了例如code(http://developer.android.com/resources/samples/BluetoothChat/index.html),但如果我发送文件大于1024字节长,然后我得到触发了事件在Handler类。 我试图发送小的TXT文件和它的工作(小于1K)。

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).

有人可以帮我请。

谢谢, 托尼

推荐答案

读缓冲区在例如设置为1024字节。每个读取,这是最大1024字节长之后,它发送一个消息到该处理程序。

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.

<一个href="http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.html" rel="nofollow">http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.html

(搜索1024)

这篇关于在Android的蓝牙聊天实例Transfering通过蓝牙文件,如的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆