2

On the Kindle Fire, as there is no Bluetooth, according to the Android documentation (at http://developer.android.com/guide/topics/wireless/bluetooth.html), if a developer calls 'getDefaultAdapter()', it should return null. However, the Kindle Fire doesn't return null in such a case. I thought that maybe if I then called 'getAddress()' that that might work. It works on some devices but on others, 'getAddress()' may return null if the Bluetooth hasn't been enabled so that doesn't work either. I found this guy: http://groups.google.com/group/Android-developers/browse_thread/thread/fcb2e20713c6795c but doesn't seem like anyone has offered a solution.

For now, I'm checking if either the Bluetooth adapter is null or if the device model is 'Kindle Fire' but I really don't want to do this and would definitely prefer a more general solution. Anyone have any ideas?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
fatfreddyscat
  • 835
  • 3
  • 8
  • 26
  • Same problem on RIM Playbook - it returns an adapter even though it doesn't support Blueooth. (Note that the Playbook actually has Bluetooth but doesn't support Bluetooth apps.) – Tom Apr 19 '12 at 18:15

1 Answers1

1

Try hasSystemFeature("android.hardware.bluetooth"), called on PackageManager.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • seems to work... thank you very much kind sir. Now, how to test whether a devices supports 'Settings.ACTION_WIFI_SETTINGS' intent??? (or, do you want me to create a separate question for that so that you can get extra points?).... Kindle Fire doesn't support 'Settings.ACTION_WIFI_SETTINGS' so, currently, I test if the device model is 'Kindle Fire' and, if so, I use the intent 'Settings.ACTION_WIRELESS_SETTINGS' as Kindle Fire seems to support that but I'm sure that this isn't a very good way... – fatfreddyscat Mar 13 '12 at 00:07