本文介绍了在Android设备上确定蓝牙堆栈版本编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何找到蓝牙堆栈版本在Android设备上编程?
例如,要查找Android版本的方法是 android.os.Build.VERSION.RELEASE 。那么,有没有任何类似的方法找出蓝牙堆栈版本?
解决方案
INT版本=的Integer.parseInt(Build.VERSION.SDK);
字符串bluezStack =;
开关(版本){
案例Build.VERSION_ codeS.BASE:
案例Build.VERSION_ codeS.BASE_1_1:
案例Build.VERSION_ codeS.CUPCAKE:
案例Build.VERSION_ codeS.DONUT:
bluezStack =配合bluez 3.36;
打破;
案例Build.VERSION_ codeS.ECLAIR:
案例Build.VERSION_ codeS.ECLAIR_0_1:
案例Build.VERSION_ codeS.ECLAIR_MR1:
案例Build.VERSION_ codeS.FROYO:
bluezStack =配合bluez 4.47;
打破;
案例Build.VERSION_ codeS.GINGERBREAD:
案例Build.VERSION_ codeS.GINGERBREAD_MR1:
案例Build.VERSION_ codeS.HONEYCOMB:
案例Build.VERSION_ codeS.HONEYCOMB_MR1:
案例Build.VERSION_ codeS.HONEYCOMB_MR2:
bluezStack =配合bluez 4.69;
打破;
默认:
打破;
}
How do I find the Bluetooth stack version on an Android device programatically?
For example, the way 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;
}
这篇关于在Android设备上确定蓝牙堆栈版本编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!