0

It would be cool to make android behave as if it's a real USB drive when connecting the device to TV and PC(s). So we don't get things like "Unsupported" and make many things possible. I tried doing some diggings and found it was pretty easy in older versions of Android according to this xda post due to USB mass storage.

Since it was possible to emulate as USB drive, I'm sure it still is possible now.

**In Android 4.4 I found a structure sys>devices>virtual>android_usb>android0>f_mass_storage. My guess is, this can be used for emulating USB drive(guess cause, I'm a total newbie yet to firefup Android studio and write code on it). But I can't find this structure on Android 10(f_mass_storage is missing). Is there there something like this in Android 10 or any workaround with it in Android 10?

**mount my system file. Create a block device mmcblk1(not sure if I used the right term, like /dev/sda in Linux). Format it with USB alike file type( like /dev/sda1 in Linux ). And somehow direct to this location when a USB cable is connected to a TV or etc throught an app. Also do I have build a USB drive protocal here instead of Android default protocol?, it's kinda getting messy.....

Am I with a wrong concept to pull this off? If yes, any advice how to do it? Also any reference/article related to it would be much appreciated (as mentioned, total newbie :/ )

3
  • USB Mass Storage (UMS) mode is thoroughly explained in my answer to Why can't I see Android storage as a partition on PC? Jan 4, 2022 at 14:43
  • Thanks a bunch. I spent hours after hours reading the last few days(curse ggl and ddg). Your post/answer was so far the best! If its okay with you, from your expertise, can you recommend me a book(s)/article(s)/topics? I am curious on how android is exposed as USB programmatically! I will try to reprogram the whole thing myself in future, if I have the chance. Thanks for your valueable time :)
    – Tanzin
    Jan 5, 2022 at 7:58
  • Update- I got the start line. Linux usb gadget. But I'm having hard time with tings like if my device have CONFIG_USB_CONFIGFS_MASS_STORAGE enabled) stuffs. Any advice for this?
    – Tanzin
    Jan 5, 2022 at 14:18

0

Browse other questions tagged .