开发者

Example project showing how to send bluetooth data from a computer to Android phone

开发者 https://www.devze.com 2023-03-25 19:45 出处:网络
One part of the project we are trying to undertake involves sending a message over bluetooth from a computer to an android phone.I was wondering if anyone has done 开发者_开发问答something like this a

One part of the project we are trying to undertake involves sending a message over bluetooth from a computer to an android phone. I was wondering if anyone has done 开发者_开发问答something like this already who might be able to share some example code with us.

Thanks Fernando


I would highly recommend checking out the following example: BluetoothChat @ developer.android.com

I did a project a few months back where we designed a body-worn, wireless sensor board that would send readings to an Android phone over Bluetooth, and this example got me started. I apologize, but I cannot share my exact code at the moment.

The example allows two Android phones to chat with one another over Bluetooth and prints the messages to the screen. With a few changes to this example, you can send the raw data you need instead of user input. The BluetoothChatService class in that example (seen here) handles all the ugly stuff (listening for connections, connecting, etc) for you.

Good luck!

0

精彩评论

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