I have an Android-based Huawei tablet, running Lollipop, and want to know how to detect when USB Mass Storage OTG has been hotplugged, and how to copy files from the OTG to tablet internal storage once the device is connected.
I haven't been able to find a workable solution after some searching. For example, the following StackOverflow answers didn't provide a workable solution for my case. Just wondering if anyone can suggest a document, project or sample code to look at to solve the problem, or could point me the APIs I'd need to use?
Transfer Files USB Mass Storage OTG
How app can access files on USB OTG storages in Android 6.0 (API level 23) without root?