The program checks to see if the device has bluetooth. If the device does and it isn’t turned on the program will prompt the user to turn it one. Once bluetooth is running it lists the paired devices.
You should be able to create a new Android project in eclipse and then copy the code included below into the appropriate file.
As the SDK Emulator doesn’t emulate bluetooth this example will not run in the emulator.
This example is built upon the information in the Bluetooth Dev Guide on the Android Developers site and the Android-Java Bluetooth on Samsung Galaxy post on stackoverflow.com.
Below the code attachments you will find a screen capture of what it looks like running on my Acer A100.
If you have any suggestions or questions please post them as comments.
goes in <ProjectRoot>\src\com\example\showpaired\
goes in <ProjectRoot>\res\values\
goes in <ProjectRoot>\res\layout\
goes in <ProjectRoot>
Screen Capture from Acer A100
- The code highlighting is done using SyntaxHighlighter which is maintained by Alex Gorbatchev and can be found at http://alexgorbatchev.com/SyntaxHighlighter/.
- This example is built upon the work of others. I post it here not as an example of original work but rather as a complete working example for reference. If I didn't appropriately credit you for your work please let me know and I will add you.