Determining Bluetooth stack version programatically on an Android device
How do I find the Bluetooth stack version on an Android device programatically?
For example, the w开发者_StackOverfloway to find the Android version is android.os.Build.VERSION.RELEASE. So, is there any similar way to find out the Bluetooth stack version?
int version = Integer.parseInt(Build.VERSION.SDK);
String bluezStack = "";
switch (version) {
case Build.VERSION_CODES.BASE:
case Build.VERSION_CODES.BASE_1_1:
case Build.VERSION_CODES.CUPCAKE:
case Build.VERSION_CODES.DONUT:
bluezStack = "Bluez 3.36";
break;
case Build.VERSION_CODES.ECLAIR:
case Build.VERSION_CODES.ECLAIR_0_1:
case Build.VERSION_CODES.ECLAIR_MR1:
case Build.VERSION_CODES.FROYO:
bluezStack = "Bluez 4.47";
break;
case Build.VERSION_CODES.GINGERBREAD:
case Build.VERSION_CODES.GINGERBREAD_MR1:
case Build.VERSION_CODES.HONEYCOMB:
case Build.VERSION_CODES.HONEYCOMB_MR1:
case Build.VERSION_CODES.HONEYCOMB_MR2:
bluezStack = "Bluez 4.69";
break;
default:
break;
}
精彩评论