如何在android中收听和接受BluetoothSocket



我正在三星GT-P7500安卓平板电脑中开发蓝牙SPP程序。我想从对等BT设备接收SPP连接。我尝试了API方法:

public BluetoothServerSocket listenUsingRfcommWithServiceRecord(String name, UUID uuid);
public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid);

并用反射法试用了CCD_ 1。所有这些都没有成功。我已经在其他安卓设备上尝试过我的程序,索尼爱立信X10i,Galaxy 9100,在这些设备上还可以。有人有Android蓝牙开发经验和GT-P7500经验吗?坦克有什么建议!

您可以看看"BluetoothChat"代码的示例,它非常有用。以下是链接:http://jayxie.com/mirrors/android-sdk/resources/samples/BluetoothChat/index.html,您可以从SVN服务器下载源代码,也可以在互联网上搜索源代码。

最新更新