Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Check if you have the Bluetooth Classic / LE on your android device with Delphi

Digital solution partner

Check if you have the Bluetooth Classic / LE on your android device with Delphi

By XE7 version of Delphi components are available to manage Bluetooth Classic and LE. With FireMonkey is quite simple also create a bluetooth server. Trying my applications on Raspberry PI3 where Federico mounted Marshmallow I am aware that if BT is not available on the device the app crashed.
To overcome this problem I tried the Java API that would allow me to check if it actually was available on the BT device and it was a lot easier than you thought.
Through Androidapi.Helpers library can test whether any feature / device is available on the device being used by the command.
“SharedActivityContext.getPackageManager (). HasSystemFeature (StringToJString ( ‘‘));”.
The list of testable devices is available on the documentation of Google at: http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_BLUETOOTH