简体   繁体   English

列出在Android电视上插入的外部存储器目录名称?

[英]List out inserted External Memory Directory Name on Android Tv?

Android-TV has 2 or more USB ports. Android-TV具有2个或更多USB端口。 I need to list out the available usb driver name. 我需要列出可用的USB驱动程序名称。 User can choose any one of the USB device name, I want to list out the list of file by usb name selection. 用户可以选择任何一个USB设备名称,我想通过USB名称选择列出文件列表。

Have a look at this link 看看这个链接

especially the code 特别是代码

UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
...  
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
UsbDevice device = deviceList.get("deviceName");

Please note that you will need the necessary permissions in your Manifest. 请注意,您需要在清单中获得必要的权限。

See Manifest Requirements 请参阅清单要求

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

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