need this permission:
<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
and code snap:
AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
if (audioManager.isWiredHeadsetOn()
|| audioManager.isBluetoothA2dpOn()
|| audioManager.isBluetoothScoOn() ) {
// headset connected
}
Subscribe to:
Post Comments (Atom)
Enable HP Zbook Thunderbolt 3 Dock on Ubuntu
As mention in previously post, I installed Ubuntu on my HP ZBook. After two days used all things work just fine, but the Thunderbolt 3 Dock ...
-
As mention in previously post, I installed Ubuntu on my HP ZBook. After two days used all things work just fine, but the Thunderbolt 3 Dock ...
-
To create a button in Android app like this: The layout XML: <Button android:layout_width="match_parent" andro...
-
Recently I tried to setup and build react-native app (mostly for Android), behind a proxy server. To pass the gradle build, need set proxy c...
No comments:
Post a Comment