I want to write a program to detect any external device that my Android phone is connected to. For example, if I connect to a computer for sharing with usb mass storage or if I connect for charging.
Which API or package in android is responsible for hardware interfaces. How can I detect any external device if it is connected to my Android phone.
source
share