tags:

views:

70

answers:

1

There are tons of pay and free bluetooth toggles on the market that work with Android 1.5 (SDK level 3). The problem is there is no visible API for this!

Does anyone have any working code snippits on how to enable and disable bluetooth that works on Android 1.5? I assume you must have to use some kind of reflection for it. There are some examples over on anddev.org, but they only work with Android 1.1 or lower.

This is for Android 1.5 (SDK level 3) and not Android 2.0 or greater. In Android 2.0 or later Google added easy to use APIs.

+2  A: 

This may/may not be useful to you as a better example: http://code.google.com/p/android-wifi-tether/source/browse/#svn/trunk/src/android/tether/system

It selects the right classed based on the SDK level and then uses it to enable/disable bluetooth.

Lee
Works great. I had to change the eclair part around to use reflection so it is Android 1.5 compatible, but it appears to do the trick!
pcm2a