Hi Sho.
I just tried similar and got the same result as yours.
0. Ensure that Bluetooth events are observable:
<uses-permission android:name="android.permission.BLUETOOTH" />
1. Set up broadcast intent listener:
IntentFilter filter1 = new
IntentFilter(BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT);
this.registerReceiver(mReceiver, filter1);
2. Handle caught event:
if (BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT.equals(action))
Toast.makeText(getBaseContext(), String.format("AT command"),
Toast.LENGTH_SHORT).show();
Feedback from anyone who has used/verified the use of this Intent would be
gladly appreciated.
Thank you.
--
On Friday, August 31, 2012 3:46:10 PM UTC+8, Sho Lin wrote:
>
> Hi All,
>
> I implemented an app. which register a BroadcastReceiver to handle
> BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT intent.
>
> When my phone connects to a headset which sends AT command
> "AT+XEVENT=foo,3" via handsfree profile,
> I expected my app. to get a broadcast intent
> of BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT.
>
> But my app. got nothing.
> (I wrote another app. to broadcast
> a BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT intent, my app.
> could receive it)
>
> For what kind of handsfree AT commands that android would broadcast
> a BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT intent?
> Or did I miss anything to receive correctly?
>
>
> Any help would be greatly appreciated, thanks.
>
> Sincerely,
> Sho
>
>
>
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en