headset

Windows Phone 8 API for Headset control events [closed]

有些话、适合烂在心里 提交于 2019-12-24 08:39:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Is there an API for Windows Phone 8 which allows to receive headset events, such as when a user presses the play/stop button? I would be interested in these events to react in my application accordingly. Regards, 回答1: If you are in control of the audio/video on the device at this point (via MediaElement or

App crash on headset button click

◇◆丶佛笑我妖孽 提交于 2019-12-23 19:42:02
问题 I have build an audioplayer which is deployed in android google playstore. I'm using crashlytics to monitor crashes and ANRs. Recently I have been getting a lot of crashes MediaButtonReceiver. The headset clicks work fine in many devices. But some devices are giving this problem. Crashlytics report - Fatal Exception: java.lang.RuntimeException: Unable to start receiver android.support.v4.media.session.MediaButtonReceiver: java.lang.IllegalStateException: Could not find any Service that

Connect to bluetooth headset in android

无人久伴 提交于 2019-12-23 03:13:03
问题 I have following problem: When my headset is turned on before my phone bluetooth is on, it will not connect to my phone. It will only connect to my phone when phone bluetooth is on and my headset is turned on second. I found out that I can still connect to my headset when bluetooth is turned on second (1. case), by going into androids bluetooth menu where my paired devices are listed and select my headset (although my headset is listed as 'connected'). This will connect my headset and my

USB type-c headset detection in Android

筅森魡賤 提交于 2019-12-22 10:49:50
问题 Sorry for question. It's my first time here. I did some search on net but no result. Really need help to clarify this problem. I have two question about USB headset detection and status query. My target device is running Android version 7.1.1. The device has a USB type-c connector and support USB type-c headset. However it seems AudioService will not send intent when USB headset status changed. Does OEM have to implement his own intent for this case? For traditional wire headset, I can use

AudioManager.isWiredHeadsetOn() is not working in android

北城余情 提交于 2019-12-19 07:55:16
问题 I want to check whether heaset is plugged in or not... I did it like this AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE); Log.i("am.isWiredHeadsetOn()", am.isWiredHeadsetOn()+""); But i am always getting false value... Why is this happening? 回答1: It looks like this is a bug. You will always get false when calling isWiredHeadsetOn unless your add MODIFY_AUDIO_SETTINGS permission to AndroidManifest.xml : <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /

Detect Headset buttons double click and Long press(click) Android

不想你离开。 提交于 2019-12-12 02:54:29
问题 Detect Headset buttons double click and Long press(click) Android I am trying the bellow code public class MediaButtonReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.e("----onReceive--", " "); if (Intent.ACTION_HEADSET_PLUG.equals(intent.getAction())) { Log.e("----jack out--", " "); if (intent.getExtras().getInt("state") == 1)// if plugged Toast.makeText(context, "earphones plugged", Toast.LENGTH_LONG) .show(); else Toast.makeText

Way to ensure delivery of Action HEADSET_PLUG for ZTE T815 Android phone

*爱你&永不变心* 提交于 2019-12-12 02:02:55
问题 I have registered a BroadcastReceiver to receive ACTION_HEADSET_PLUG which works fine for most devices, ie it is called whenever the headset is plugged or unplugged. But on others eg the ZTE T815, the Intent is never sent/received when the headset is plugged/unplugged. For reference here is the code for the receiver registration: private final BroadcastReceiver headsetPlugReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.d(TAG,

MEDIA_BUTTON button event ACTION_DOWN and ACTION_UP received at the same time

▼魔方 西西 提交于 2019-12-11 13:23:32
问题 In my app I want to measure how long the media button press was. I registered a broadcastReceiver that listens to the media button press: (please excuse stupid mistakes as I am a beginner...) <receiver android:name="MyRec"> <intent-filter> <action android:name="android.intent.action.MEDIA_BUTTON"> <action android:name="android.intent.action.MEDIA_BUTTON"/> </action> </intent-filter> </receiver> The broadcastReceiver activates a method in an activity (not ideal, but this is just for testing

How to detect headset button double click in HTC phones with broadcast receiver?

浪尽此生 提交于 2019-12-11 02:18:18
问题 I'm developing a headset button controller and use a broadcast receiver for detecting headset button presses. ((AudioManager) getSystemService(AUDIO_SERVICE)).registerMediaButtonEventReceiver(new ComponentName(getPackageName(), MediaButtonIntentReceiver.class.getName())); onReceive method: public void onReceive(Context context, Intent intent) { String intentAction = intent.getAction(); if (!Intent.ACTION_MEDIA_BUTTON.equals(intentAction)) { return; } KeyEvent event = (KeyEvent) intent

Android detect headset plugin through USB port

笑着哭i 提交于 2019-12-09 20:51:56
问题 There is a new technology of headset that soon will be popular with more devices. Devices has a type-C jack only without 3.5MM jack (Aux), and I would like to detect a plugin connection for listen music. The regular way to detect Aux connection is ACTION_HEADSET_PLUG Please help me find a solution for this problem. Thanks. 来源: https://stackoverflow.com/questions/38498831/android-detect-headset-plugin-through-usb-port