开发者

Android - Enabling and Disabling Bluetooth - SDK 3 (OS 1.5) - programatically?

开发者 https://www.devze.com 2022-12-18 13:56 出处:网络
I have written code to enable and disable various things programatically like Wifi, Ringer modes, Airplane modes.All things that you would see in a power toggle widget.

I have written code to enable and disable various things programatically like Wifi, Ringer modes, Airplane modes. All things that you would see in a power toggle widget.

The one that I have not found out开发者_运维百科 how to do is bluetooth. It appears that in SDK level 3 (OS 1.5) there is no pretty bluetooth manager class. Has anyone pinpointed any good source examples on enabling and disabling bluetooth that will also be forwards compatible with users running 2.0 (Droid) / 2.1 (Nexus)?

I have found a few partial examples in my google searches that I could not get to actually run.

Thanks!


http://developer.android.com/guide/topics/wireless/bluetooth.html

This has alot of great examples and teaches you the basic gist of starting up bluetooth and getting sockets.

You should probably read the whole thing but just for a quick starter look at the section called "Setting Up Bluetooth"

0

精彩评论

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

关注公众号