請教大神們個問題: 我用的是Android android.hardware.usb包,我想實現(xiàn)的需求是:一個U盤插在我的Android設(shè)備上的USB Host口,1.能檢測到U盤 2.在我的程序里界面上能顯示U盤的內(nèi)容(有那些文件夾,文件,類似于資源管理器)。 現(xiàn)在確實能檢測到U盤,第一條實現(xiàn)了 第2條還沒實現(xiàn),我還沒想到怎么遍歷U盤里文件或文件夾 UsbDevice API里有兩種數(shù)據(jù)傳輸方法 1.controlTransfer(int requestType, int request, int value, int index, byte[] buffer, int length, int timeout) Performs a control transaction on endpoint zero for this device. 2.bulkTransfer(UsbEndpoint endpoint, byte[] buffer, int length, int timeout) Performs a bulk transaction on the given endpoint. 這兩種方法也只是傳輸數(shù)據(jù),要實現(xiàn)我說的顯示U盤的內(nèi)容(有那些文件夾,文件,類似于資源管理器)怎么實現(xiàn)那? 請大神指教下 2013-06-17 09:08:52 回復
|
|