headset

How to get Bluetooth Headset connection state on application start-up using Android2.2?

一曲冷凌霜 提交于 2019-12-08 06:19:50
问题 How to get Bluetooth Headset connection state (connected/disconnected) using android api level 8 on application start-up? Is there any sticky broadcast intent available in android2.2? Is there any API to fetch initial Bluetooth Headset state? Is there any workaround available? 回答1: I figured out the solution: private static final String ACTION_BT_HEADSET_STATE_CHANGED = "android.bluetooth.headset.action.STATE_CHANGED"; private static final int STATE_CONNECTED = 0x00000002; private static

How to receive a call from GSM Modem

为君一笑 提交于 2019-12-08 04:42:58
问题 I am fairly new to this area so it might look silly but I have a gsm modem connected to my pc through usb port. If somebody calls that number i need to pick it up and transfer to my headset. Is it possible? Any ideas. 回答1: Yes obviously its possible use AT Commands http://www.owen.ru/uploads/re_pm01_list_command.pdf try it works fine. 回答2: As @arun kumar non ascii mentioned you can answer the call using ATA . You can also know the number of person calling you (i.e. Caller ID) by executing AT

Connect to bluetooth headset in android

一曲冷凌霜 提交于 2019-12-06 16:33:19
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 phone too. What I now want to do is to perform the second way of connecting to my headset, when my phone

USB type-c headset detection in Android

旧巷老猫 提交于 2019-12-05 21:44:23
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() to check it's status. But USB type-c headset seems not work in this way.

Android - checking headset button click

北战南征 提交于 2019-12-05 06:29:32
问题 How can I checked if play/pause button in my headset is clicked? After that can I implement some method that could change typical action (play/pause) for my own action (shut down etc.) ? 回答1: If you are trying to listen for this from an activity in the foreground, use onKeyDown() and watch for KEYCODE_MEDIA_PLAY_PAUSE . Use a BroadcastReceiver for ACTION_MEDIA_BUTTON if you are trying to listen for this event from the background (e.g., a service playing music). 回答2: Right now I am using below

What triggers (or generates) KeyEvent.ACTION_MULTIPLE?

与世无争的帅哥 提交于 2019-12-04 17:35:44
问题 The documentation for KeyEvent.ACTION_MULTIPLE says: "multiple duplicate key events have occurred in a row, or a complex string is being delivered. If the key code is not {#link KEYCODE_UNKNOWN then the {#link getRepeatCount() method returns the number of times the given key code should be executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this is a sequence of characters as returned by getCharacters()." But it doesn't say how to actually generate that event. I tried (rapidly)

ACTION_HEADSET_PLUG broadcast delay

这一生的挚爱 提交于 2019-12-04 13:34:38
问题 I have my own BroadcastReceiver instance for Intent.ACTION_HEADSET_PLUG action. There is about 1-2 seconds delay between actual physical unplugging a headset and a moment when my BroadcastReceiver is notified about that. IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG); filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1); registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // my code here } }, filter); Any ideas

Making a notification icon appear on boot/headset plugin

会有一股神秘感。 提交于 2019-12-04 05:43:59
问题 I want to make it so when one plugs in there headset a notification icon appears. I've made it so when the phone turns on this runs which starts the MainActivity class which has the code for the notification icon in the OnCreate method so it just automatically starts. The problem with that is that it starts the whole activity and app, which I don't want. I just want the icon to appear. How could I go about this? Thank You! public void onReceive(Context context, Intent intent) { // TODO Auto

What triggers (or generates) KeyEvent.ACTION_MULTIPLE?

邮差的信 提交于 2019-12-03 11:07:13
The documentation for KeyEvent.ACTION_MULTIPLE says: "multiple duplicate key events have occurred in a row, or a complex string is being delivered. If the key code is not {#link KEYCODE_UNKNOWN then the {#link getRepeatCount() method returns the number of times the given key code should be executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this is a sequence of characters as returned by getCharacters()." But it doesn't say how to actually generate that event. I tried (rapidly) double-clicking the headset's Pause/Play button, but all I receive is ordinary ACTION_UP and ACTION_DOWN. I

Making a notification icon appear on boot/headset plugin

半世苍凉 提交于 2019-12-02 08:04:23
I want to make it so when one plugs in there headset a notification icon appears. I've made it so when the phone turns on this runs which starts the MainActivity class which has the code for the notification icon in the OnCreate method so it just automatically starts. The problem with that is that it starts the whole activity and app, which I don't want. I just want the icon to appear. How could I go about this? Thank You! public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub Intent myIntent = new Intent(context, MainActivity.class); myIntent.addFlags