简体   繁体   English

在Android中检测USB设备

[英]In android Detect USB devices

How does android detect USB devices and show the notifications? Android如何检测USB设备并显示通知? How does android handle this functionality and what is its AOSP code. android如何处理此功能以及它的AOSP代码是什么。

When there is some energy change in the device, when there is not, I believe there is no way to see if the USB is plugged or not. 当设备中发生一些能量变化时,如果没有变化,我相信没有办法查看USB是否已插入。

You should make BroadcastReceiver to see when there is an action of Usb Attached or Detached. 您应该使BroadcastReceiver看到何时有附加或分离的USB操作。

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

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