4

My question is somewhat large, but I couldn't figure out how to break it down without ruining it.

There doesn't seem to be a very good (functioning) way of mounting a Nexus 4 in Ubuntu, so I was thinking of writing some kind of adb wrapper, because adb works nicely. So my question is:

What are the layers/system parts between Nautilus/Nemo and a removable storage device and how do they work?

  • How does a GUI file manager like Nautilus fetch folder contents and file details. Does it throw commands like ls, cd in the background?
  • Which system part is in charge when you're browsing /media and how does it work? Can I place my own handler here somewhere?
  • Is what I'm thinking about possible at all?
1
  • I think you may need a better usb-driver, because maybe your nexus 4 is using a bit different scsi protocol. Sep 22, 2014 at 15:29

1 Answer 1

2

Does MTP Help?

There doesn't seem to be a very good (functioning) way of mounting a Nexus 4 in Ubuntu, […]

I was wondering if you knew about the MTP protocol? It seems to be the main way for accessing media data of Android devices without SD cards via USB.

Modern Ubuntu versions (>= 13.04) should ship MTP support for Nautilus already. For older Ubuntu versions (e.g., 12.04) you might have to install a library upgrade manually or from a PPA.

You might also have to turn MTP support on in your Android device under “System settings” → “Storage” → “USB connection (PC)”

GVFS, FUSE, etc.

[…] I was thinking of writing some kind of adb wrapper, because adb works nicely. So my question is:

What are the layers/system parts between Nautilus/Nemo and a removable storage device and how do they work?

  • How does a GUI file manager like Nautilus fetch folder contents and file details. Does it throw commands like ls, cd in the background?

There are a lot of different layers involved, but definitely Nautilus does not run those shell commands in the background; this would be way too slow.

The main layer you should look into for your project is GVFS. According to Wikipedia, “GVFS is the virtual filesystem for the GNOME desktop, which allows users easy access to remote data via SFTP, FTP, WebDAV, SMB, and local data via Udev integration, OBEX, MTP and others.”

Since GVFS has support for FUSE (which may be another interesting layer for our discussion), you might try something like adbfuse. It wraps ADB in a FUSE driver which can then be used by Nautilus via GVFS. Please note that I haven’t tried this, however, I would be interested in hearing about any experiences you might make with it :-)

  • Which system part is in charge when you're browsing /media and how does it work? Can I place my own handler here somewhere?

I’m not entirely sure about this but I think udisks eventually makes sure that you see removable storage devices under /media.

  • Is what I'm thinking about possible at all?

It’s certainly possible as you can see with adbfuse; just run a web search for “fuse android adb” and you’ll get a few similar projects :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .