Android的蓝牙编程code样品蓝牙、样品、Android、code

2023-09-12 07:11:24 作者:#强迫症

我是新来的Andr​​oid。我在寻找一些code样品进行 Android的蓝牙编程。能否请您发表他们对我?任何有用的链接将是AP preciated。

I'm new to Android. I'm looking for some code samples for Android Bluetooth programming. Could you please post them for me? Any useful link would be appreciated.

推荐答案

我意识到这是一个古老的线程,但我想我会记一些笔记。 Android的蓝牙例子(已上市),有一堆的问题(而不是最重要的是你需要2 Android设备才能正常发挥作用)。

I realize this is an old thread, but I thought I'd jot some notes. The Android Bluetooth example (already listed) has a bunch of issues (not the least of which is you need 2 Android devices to get it to function).

看看这个例子在http://luugiathuy.com/2011/02/android-java-bluetooth/ 在那里,他是利用蓝牙在Android设备上打一个服务器(做一些机器人的工作)。

Take a look at the example at http://luugiathuy.com/2011/02/android-java-bluetooth/ where he is using BlueTooth on the Android device to hit a server (to do some robotics work).

请注意UUID问题(蓝牙决定哪些连接,它可以使在UUID的定义方式),并检查了 http://www.avetana-gmbh.de/avetana-gmbh/produkte/doc/javax/bluetooth/UUID.html

Be aware of UUID issues (the way that BlueTooth decides what connection it can make is defined in the UUID), and check out http://www.avetana-gmbh.de/avetana-gmbh/produkte/doc/javax/bluetooth/UUID.html

请记住,16位重新psented的UUID(即 0x1101 的串行端口)被误导的,其真正的最低显著的一部分,$ P $必须是codeD 0x00001101

Keep in mind that the 16 bits represented in the UUID (ie, 0x1101 for Serial Port) is misleading in that its really the least significant part and needs to be coded 0x00001101.

 
精彩推荐