简体   繁体   English

连接蓝牙医疗设备时启动Android应用程序

[英]Start Android Application when bluetooth medical device is connected

I have a newbie question about Bluetooth:我有一个关于蓝牙的新手问题:

If I connect my Android phone to a medical device with Bluetooth (or Bluetooth LE) Interface, is there a way to have an application automatically started?如果我将我的 Android 手机连接到具有蓝牙(或蓝牙 LE)接口的医疗设备,是否可以自动启动应用程序?

I have used a Broadcast Receiver in my application to monitor the "ACTION_CONNECTION_STATE_CHANGED" notification.我在我的应用程序中使用了广播接收器来监视“ACTION_CONNECTION_STATE_CHANGED”通知。 I can use it to start my application but we succeeded to get it work only with a HID Profile (which is supported natively by Android).我可以使用它来启动我的应用程序,但我们成功地让它只与HID 配置文件(Android 原生支持)一起工作。 We didn't succeed with a Health Device Profile .我们没有成功使用Health Device Profile

Is it something feasible?这是可行的吗?

Thanks谢谢

https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration

Health Device Profile is deprecated from API level 29. New apps should use Bluetooth Low Energy based solutions such as BluetoothGatt, BluetoothAdapter#listenUsingL2capChannel(), or BluetoothDevice#createL2capChannel(int)健康设备配置文件已从 API 级别 29 弃用。新应用应使用基于蓝牙低功耗的解决方案,例如 BluetoothGatt、BluetoothAdapter#listenUsingL2capChannel() 或 BluetoothDevice#createL2capChannel(int)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM