Manu
Manu

Reputation: 29

Android communication with a USB device

It's been a month that i try to connect my USB device, in mass storage to my tablett (Google Nexus 7). I have read all the google documentation about Android USB host, and i find nothing to read the file inside my USB device !

I have search trough differents forums, found few app doing USB viewer (Nexus media importer for exemple) but i haven't found any source code able to read files on an USB key, in mass storage.

I am now trying to implement the USB mass storage protocol, with the method

bulkTransfer (UsbEndpoint endpoint, byte[] buffer, int length, int timeout)

But i don't know how to have the access to the device directories ...

Anyone has already solve this communication issue ?

Upvotes: 2

Views: 3056

Answers (2)

M Granja
M Granja

Reputation: 865

Does the root of the external storage show when you run the method below?

Context.getExternalMediaDirs()

If so, you should be able to just open the file, using the path returned.

Upvotes: 0

TronicZomB
TronicZomB

Reputation: 8747

First of all, do you have the OTG cable that will tell the Nexus 7 to go into host mode? Secondly, you may want to read this. The Nexus 7 supports USB Host mode for devices such as keyboards and mice, but does not support Host mode for storage devices.

Upvotes: 1

Related Questions