Technical backgrounds of TC

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
vincent_p
Junior Member
Junior Member
Posts: 2
Joined: 2014-07-24, 11:56 UTC

Technical backgrounds of TC

Post by *vincent_p »

Hi everyone,

I am not sure if this question has been answered before, search didn't turn up anything.

I am an app developer and am wondering how TC works. Right now we try to develop an android app that writes a file to an attached USB mass storage device (e.g. USB key). We have problems writing to USB on some devices.

The android APIs destinguish two different ways of writing permanent data. One is to write to internal space (which is the phone's build in memory) and one is external space. External usually means a SD Card. So there is no API for USB drives connected via USB on the go. We tried to manually find the connected devices by looking through the mounted drives. This works very well and on some of our test devices we could simply open a FileDescriptor and write to a file (e.g. /mnt/usbdevice0/test.file).

Unfortunately this doesn't work on every device we tested. On some we get an error because the filesystem is read-only. We could not find a way round that using the normal File API.

So here is the question: With Total Commander we were able to write to the files, even on the devices on which our own app can't write because of a read-only filesystem. How does TC do that? Does TC use the normal file API when writing to connected USB drives? Or does TC implement some of the Accessory Stack an manually connects to the mass storage device?

Any pointers and hints would be highly appreciated!

Thanks!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Total Commander is using the media functions to write to the card when the normal functions are blocked. Unfortunatrly this only works with older Android versions than 4.4, plus some Samsung devices with 4.4 (e.g. the S4, but not the S5):
http://ghisler.ch/board/viewtopic.php?t=34834&start=15
Author of Total Commander
https://www.ghisler.com
vincent_p
Junior Member
Junior Member
Posts: 2
Joined: 2014-07-24, 11:56 UTC

Post by *vincent_p »

Thanks ghisler! That is very helpful!
Post Reply