There is a project on Github usb-serial-for-android
It is a library to communicate with Arduinos and other devices via USB on Android, using the Android USB Host API (Android 3.1+)
You don’t need access to Root because it implements the drives in Java itself, which provides an api for Android to receive (read) and send (write) to USB.
Code snippet, see more in sample project (https://github.com/mik3y/usb-serial-for-android/tree/master/UsbSerialExamples)
// Encontra o UsbManager do Android.
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
// Encontra o primeiro Driver disponivel.
UsbSerialDriver driver = UsbSerialProber.acquire(manager);
if (driver != null) {
driver.open();
try {
driver.setBaudRate(115200);
byte buffer[] = new byte[16];
int numBytesRead = driver.read(buffer, 1000);
Log.d(TAG, "Read " + numBytesRead + " bytes.");
} catch (IOException e) {
// Deal with error.
} finally {
driver.close();
}
}
Not all are flowers, because the project is still in version v0.1.0 and the last time it was updated was in 2012. At least the project be well documented.
I hope I’ve helped you.
If you plug an Android into a PC, you can read and write to its internal memory. Also the device itself usually allows you to choose the way it communicates with the PC. Which you can read and write on the door, that’s for sure - it’s not just for feeding the device. Drivers vary from manufacturer to manufacturer, but the API is one.
– Oralista de Sistemas
Here is the official documentation. If anyone wants to elaborate an answer on that, welcome.
– Oralista de Sistemas