Making Linux and Android Get Along (It's Not as Hard as It Sounds)

Direct Connection

The last, and slightly old-school way, to connect your Android device to your Linux box is via a direct USB connection. While this may evoke feelings of nostalgia for longtime gadget geeks who remember popping a Palm into a cradle and hitting the "HotSync" button, I find this to be the worst experience on newer devices, for reasons I'll explain below.

The Gingerbread (2.3.6 and below) Way

On Android devices prior to v.3.0, Google did the "right thing" to enable access to the device's filesystem. When plugged in via a USB cable, the device appears to be just another USB drive. You could move files to and fro, access documents directly on the device, and basically treat the phone or tablet just as you would any other thumbdrive (with maybe the exception of leaving it in your pocket to go through the wash).

Like SSHDroid above, once this USB storage was mounted, you could use any Linux tool at your disposal (Unison, Krusader, rsync) to make sure they were up to date. All was well, until Google tried to be too smart for its own good.

The Honeycomb (3.0 and above) Way

From Android v3.0 and up, plugging a device in via USB no longer shows up as USB storage (that is, the "easy way"). Rather, you're required to choose in the devices settings whether, on USB connection, you'd like the device to use the MTP protocol (that is, to appear to the other machine as a media player) or the PTP protocol (that is, to appear as a camera).

Now, I've read that there's a technical reason for Google's decision to do this, mainly that all applications and data now can reside on a single filesystem (as opposed to having to choose, for example, to install apps on the "phone" or on the "SD card", as I do on my OG Droid). All I would argue is that, for this user, those benefits do not outweigh the terrible experience of trying to use MTP on Linux (PTP actually works quite well, but only gives you access to the "DCIM" folder, so unless you want to store all your other stuff alongside the pictures taken by the built-in camera, this won't do).

I spent the better part of a weekend combing through posts on the XDA forums (http://forum.xda-developers.com"), which is a fantastic resource for all sorts of Android hacks, trying to find a nice, automated method of mounting the Prime's SD card. I found a couple resources (http://www.omgubuntu.co.uk/2011/12/how-to-connect-your-android-ice-cream-sandwich-phone-to-ubuntu-for-file-access and http://forum.xda-developers.com/showthread.php?t=1143044), but eventually settled on the script and instructions provided via this YouTube video: http://www.youtube.com/watch?v=3ehnoJn6CEk). After all that, I sat down, ready to see the Prime as just another drive in /media, just like the old days.

Well, not only is MTP access on Linux inconvenient to use, it's interminably slow. Once I got connected, I started copying my music collection to the Prime and left it plugged in overnight to do so. When I got up the next morning, it was approximately 5% completed. Before you start asking for transfer rates and whatnot, I don't have them, but I was able to transfer about half that same collection within a couple hours, and over SFTP (so with en/decryption overhead) no less. So I've pretty much sworn off direct connection for the Prime...there are so many other ways to shuffle files and data around, who needs it?

Conclusion

One of the great things about Android is that the ecosystem is free to come up with a variety of solutions to a problem and let users sort out which one best fits their needs. It could be that no one of the above alone will suit you—I myself use both SSHDroid and FolderSync on almost a daily basis. But all of the above apps are either free, or have free trial versions, so there's nothing stopping you from testing them out. Give it a try, and the robot and penguin will be getting along famously in no time!

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I am not

Android Phone Online Store's picture

I am not using Linux as an OS for my laptop and even to my smartphone because not all applications are compatible with it, and I am not familiar with the Linux.

Android User

Len S's picture

I do like my android phone, especially plugging it into my computer usb port, and easy access to material saved on my phone. I really enjoyed this article, thank you.

Reply to comment | Linux Journal

Sheri's picture

This info is worth everyone's attention. Where can I find out more?

Reply to comment | Linux Journal

dermatology photos Candida albicans's picture

Please let me know if you're looking for a writer for your blog. You have some really great articles and I think I would be a good asset. If you ever want to take some of the load off, I'd really like
to write some material for your blog in exchange for a link back to mine.
Please blast me an e-mail if interested. Cheers!

Reply to comment | Linux Journal

telephone siemens's picture

Write more, thats all I have to say. Literally, it
seems as though you relied on the video to make your point.
You obviously know what youre talking about, why waste your
intelligence on just posting videos to your site when you could be giving us something enlightening to read?

I love this site, thank you

zeennate's picture

I love this site, thank you to all who are created, I learned many things, very positive, a thousand thank you.
site de voyance gratuite

You should delete your

Erika's picture

You should delete your backlink. My site

Reply to comment | Linux Journal

produits anti cellulite's picture

I like the valuable info you provide in your articles.

I will bookmark your weblog and check again here regularly.
I'm quite sure I'll learn plenty of new stuff right here!
Good luck for the next!

Using Debian 7.0 and

lyemium's picture

Using Debian 7.0 and installing mtpfs and mtp-tools from the package manager gives a nice plug and play capability when connecting Android 4.1 devices.

All that is needed is to connect the device and use the thunar file to take care of all the drag and drop functionality, no complaints so far.

Like Android

Online Website Tutorials's picture

I lke linux and android, I hope this is also suppport my gadget

Samba server app

Anonymous's picture

you can make use of Samba server app for Local connection ;)

Reply to comment | Linux Journal

facebook hack's picture

I do not leave many comments, however i did some searching
and wound up here Reply to comment | Linux Journal. And I do have
a couple of questions for you if you usually
do not mind. Could it be just me or does it look like a few of the responses appear like they are written by brain dead people?

:-P And, if you are writing on additional places, I'd like to follow everything fresh you have to post. Could you make a list of every one of your community sites like your linkedin profile, Facebook page or twitter feed?

For KDE install kio-mtp

Anonymous's picture

At least in the Fedora repos the package kio-mtp is available for the KDE desktop.

Android device is automatically detected when plugged into usb connector. Pop-Up options include view folders in Dolphin or Krusader.

Read / write access is as fast as usb will go - tested with Nexus 7.

Reply to comment | Linux Journal

http://optionbinairestrategie.net's picture

When someone writes an piece of writing he/she retains the plan of a
user in his/her mind that how a user can know it.
So that's why this piece of writing is great. Thanks!

Reply to comment | Linux Journal

anticellulite creams's picture

Wow, incredible blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your site is great, as well as the content!

Android is Linux -- why no better inter-operation

Saint DanBert's picture

Linux and the several *nix systems have wonderful, LAN and NET based tools for inter-connection and inter-operation -- especially where file sharing and related operations are involved. This dates back to UUCP when modems were $1,000, were leased from telco, and were periodically connected because leased lines were extremely expensive.

I'm astonished that these tools have not become available for connecting
Android systems with Linux systems.

~~~ 8d;-Dan

Reply to comment | Linux Journal

getting your girlfriend back after you cheated's picture

Greate pieces. Keep writing such kind of information
on your site. Im really impressed by it.
Hey there, You've performed an incredible job. I'll definitely digg it and personally suggest to my friends.
I'm sure they will be benefited from this site.

Reply to comment | Linux Journal

http://www.magic-mobiles.co.uk/'s picture

Once once more bully mobile manufacturer Apple Inc. is arriving up than 3.
5 G fast net connection proffered by all major UK network divine service suppliers.

http://www.magic-mobiles.co.uk/ The initiatory lot of all-newbuy iphone 5will be
embarked on September 21, while the devices representing sold at to join us for it.

Connecting Android device to desktop Linux via USB

philip ramsey's picture

I run openSUSE on my laptop and Android 4.0 on the HTC Amaze. I discovered a number of USB tools that allows the browsing of USB storage devices. By installing USBView and USBprog, it allows the HTC Amaze to be seen as an USB storage device. It also works with the Samsung Galaxy Nexus running Android 4.1. The transfer speeds are the same as any other USB device - transfer 1 GB in minutes. The entire Android file system is accessible from the Linux laptop.

git-annex assistant

Shock's picture

you should check out git annex assistant. open source, runs on linux and has android app. it also supports sync via box.net

direct cable connection

Daniel Barlow unregistered's picture

It may not be the most user-friendly option in a GUI sense, but I've found that the simplest way to get files onto the device over a USB cable is to use "adb push"

play with linux? i think you mean work-around linux

er0ck's picture

the vast majority of the article is about platform agnostic solutions. this is great. was just surprised. :-)
i too am dismayed at how poor MTP operates under linux. it seems to work great from macOSX.
i use sshdroid (still a bit finicky including no way when i checked to upload entire folders) and sftp (isn't this root only?) as well. linux cron jobs notice when my phone is on my network and initiates some rsync stuff for mostly pics/clips, but also my evernote stuff.

Reply to comment | Linux Journal

Therese's picture

You really make it appear really easy with your presentation
however I find this topic to be really one thing which I believe I might by no means
understand. It kind of feels too complex and very large for
me. I am looking forward for your subsequent submit, I
will attempt to get the cling of it!

Reply to comment | Linux Journal

talking dirty to a girl's picture

I have learn a few just right stuff here. Definitely price bookmarking for revisiting.
I surprise how a lot attempt you put to create this type of
great informative site.

Reply to comment | Linux Journal

internet home business's picture

Thanks a lot for sharing this with all of us you actually understand what
you are speaking about! Bookmarked. Please
additionally talk over with my site =). We will have a link change arrangement among
us

Reply to comment | Linux Journal

e&o's picture

I'm gone to convey my little brother, that he should also go to see this blog on regular basis to take updated from newest news update.

Where is Epistle?

Jon Schewe's picture

I keep hearing about this great note taking app Epistle, but whenever I follow the links or search in the google play store I'm told that the page isn't there and don't find any search results.

Reply to comment | Linux Journal

vitiligo vitamin b12's picture

I have been exploring for a little bit for any high-quality articles or blog posts in this kind of
house . Exploring in Yahoo I eventually stumbled upon this website.

Reading this info So i am glad to show that I have an incredibly good uncanny feeling I found out
just what I needed. I so much without a doubt will make sure to do not overlook this web
site and give it a look regularly.

Epistle

Anonymous's picture

I used Epistle but it is no longer supported, but an app called Denote is a great substitute that does the same thing. I use it to sync notes to my Ubuntu desktop with a program called PS Notes.

You forgot OwnCloud

Paraplegic Racehorse's picture

Android (OwnCloud - https://play.google.com/store/apps/details?id=com.owncloud.android&featu....) and [many] linux distros include native OwnCloud clients. Several online archive/backup/share service providers have switched to OwnCloud to ease their internal administration issues. You can, in theory, have your cake and eat it too.

The problem is 3rd-party app support of OwnCloud on Android. There are lots of apps that talk back and forth with DropBox and Box but very very few, if any, that talk to an OwnCloud server, so if you need this, those files should be kept at those hosting sites. On the upside, your DropBox folder can be mirrored on your OwnCloud server so you don't need to worry overmuch about losing your files should DropBox ever fail for you. :)

go-mtpfs

John M Cooper's picture

Hi,

I have found go-mtpfs https://github.com/hanwen/go-mtpfs to be a really fast and stable way to access my MTP android. You have to do a bit of leg work to get it installed but after that it works great. Lets hope somebody packages soon.

john

Missed one

Kevin Seise's picture

You missed the Android side client for SSH mounting. SSHFSAndroid allows you to create mount points for your linux hosted files and treat them like sshfs mounts. Rooting is required to insert the fuse module, but it works really well on my tablets and phone. Great article by the way!.

https://play.google.com/store/apps/details?id=com.chaos9k.sshfsandroid&h...

Reply to comment | Linux Journal

http://vitiligoremediesonline.com's picture

I'll right away clutch your rss feed as I can't in finding your e-mail subscription link or newsletter service.
Do you've any? Please permit me understand in order that I could subscribe. Thanks.

Reply to comment | Linux Journal

sweet things To say to women's picture

Quality articles or reviews is the secret to be
a focus for the people to go to see the web page, that's what this web site is providing.

Reply to comment | Linux Journal

what to say to girls to get laid's picture

It's in fact very complicated in this full of activity life to listen news on Television, thus I just use the web for that reason, and obtain the hottest news.

Reply to comment | Linux Journal

Norma's picture

I loved as much as you'll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this increase.

Reply to comment | Linux Journal

anti cellulite exercises's picture

The next time I read a blog, Hopefully it does not disappoint me just as much as this one.
After all, I know it was my choice to read through, however I truly
thought you would have something interesting to say.
All I hear is a bunch of crying about something that you can fix
if you weren't too busy searching for attention.

Reply to comment | Linux Journal

luckyriches.net's picture

Hello there! Do you use Twitter? I'd like to follow you if that would be ok. I'm definitely enjoying your blog
and look forward to new updates.

Reply to comment | Linux Journal

http://yeasthomeremedy.com/'s picture

When someone writes an article he/she retains the thought of a
user in his/her mind that how a user can know it. Therefore that's why this article is perfect. Thanks!

Useful apps

Robin's picture

Two apps help greatly with the transfer of data from mobile to linux, which should also get mentioned. AirDroid permits a connection by WLAN to any computer capable of running a browser, copying files to and fro is one of the main features, though not the only one; and Bump permits the transfer of data to other mobile devices literally by bumping them against each other, and here, too, any computer running a browser and having a keyboard can be the target. You bump the space key.

Agreed on AirDroid. With my

Anonymous's picture

Agreed on AirDroid. With my Motorola Electrify M running Jelly Bean 4.1.2, plugging it into the computer results in a USB mass storage device being made available which contains the Motorola driver downloader for MS Windows. Once that driver is installed on a Windows machine the driver manages to disable the USB mass storage device and provides MTP access. This does not seem to be possible on Linux as of yet. I tried the go-mtpfs program above, but it cannot find an MTP device (it's one of several such programs I've tried.

Reply to comment | Linux Journal

reverse candida's picture

This piece of writing offers clear idea designed
for the new viewers of blogging, that genuinely how
to do blogging.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState