Android 蓝牙配件可以强制设备启动应用程序吗?
我想知道是否可以开发一个可以在您的设备上启动现有 Android 应用程序的硬件(例如可能通过蓝牙)。
我似乎找不到任何有关此类功能的文档。
有人遇到过这个吗?
I am wondering if a piece of hardware can be developed (probably over bluetooth for example) that could launch an existing android application on your device.
I can't seem to find any documentation on this kind of functionality.
Has anybody come across this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您可以使用
ACTION_DISCOVERY_[STARTED|FINISHED]
方法注册广播接收器。 链接要注册接收器,请进入项目的 AndroidManifest.xml 并添加接收器标签和一些权限标签:
然后您应该能够创建 BluetoothReceiver 类并重写 onReceive 方法。
Looks like there are
ACTION_DISCOVERY_[STARTED|FINISHED]
methods that you could register a broadcast receiver for. LinkTo register the receiver, go into your project's AndroidManifest.xml and add the receiver tag and some permission tags:
you should then be able to create the BluetoothReceiver class and override the onReceive method.
这背后的理论如下:
BroadcastIntent
BroadcastIntent
由BroadcastReceiver
接收BroadcastReceiver
启动一个应用程序。我从未在 Android 上使用过蓝牙,但当有人尝试连接到您时应该会有广播。你可以听听这个。
The theory behind this is the following:
BroadcastIntent
BroadcastIntent
is received by aBroadcastReceiver
BroadcastReceiver
launches an application.I've never used Bluetooth with Android, but there should be a Broadcast when someone tries to connect to you. You could listen to that.