[英]How to check whether the sound recording is available in a android device.?
Is there a standard way to check whether the sound recording is possible in a android device?是否有标准方法来检查 android 设备中是否可以录音?
If you absolutely need a device to have a microphone, add a <uses-feature>
element to your manifest asking for android.hardware.microphone
.如果您绝对需要设备有麦克风,请在清单中添加一个
<uses-feature>
元素,要求android.hardware.microphone
。
If you could use a microphone if it exists, then add a <uses-feature>
element to your manifest asking for android.hardware.microphone
with android:required="false"
.如果您可以使用麦克风(如果存在),则在清单中添加一个
<uses-feature>
元素,要求android.hardware.microphone
和android:required="false"
。 Then, use PackageManager
and hasSystemFeature()
to check for android.hardware.microphone
at runtime.然后,使用
PackageManager
和hasSystemFeature()
在运行时检查android.hardware.microphone
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.