我的 HTC Hero 2.1
型号=HERO200
制造商=HTC APILevel
=7有一个奇怪的问题
它没有报告它有一个硬件麦克风。这是我检查功能的代码。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Context context = this;
PackageManager pm = context.getPackageManager();
FeatureInfo[] foo = pm.getSystemAvailableFeatures();
for (FeatureInfo bar : foo) {
if (bar.name != null) {
System.out.println(bar.toString());
if (bar.name.equalsIgnoreCase("android.hardware.microphone"))
System.out.println("Booyah!");
}
}
}
它确实报告了这些功能:
android.hardware.camera
android.hardware.wifi
android.hardware.location.network
android.hardware.bluetooth
android.hardware.sensor.light
android.hardware.location
android.hardware.location.gps
android。 hardware.camera.autofocus
android.hardware.touchscreen.multitouch
android.hardware.touchscreen
android.hardware.sensor.accelerometer
android.hardware.sensor.compass
有些是 API 级别 8,如 compass 和 gps,有些是 7 级。还有其他方法可以搜索功能吗?除了 getSystemAvailableFeatures() 之外我还可以使用什么?也许是较低级别的系统调用?为什么我的手机没有报告它有硬件麦克风?请帮助:)谢谢!