43

I want to move some files from my PC to Nexus 7. The tablet is connected to my PC's USB port and it is successfully charging. Unfortunately, the PC is not detecting the devices - what I expected is to be shown the Nexus 7 tablet as external devices (like my USB flash memory).

As the tablet is connected to the my home internet network, I have checked if it will appear in the "Networks" section but it does not.

I am using Ubuntu 12.04 LTS.

Is there a easy way to connect the devices to my PC and move some information between them?

Braiam
  • 67,791
  • 32
  • 179
  • 269
gotqn
  • 2,047
  • For the record this doesn't work on Windows7 either. – NoBugs Dec 26 '13 at 21:09
  • A lot time has been spent on reading and trying then, instead (like now) using the Ubuntu One. – gotqn Jan 19 '14 at 19:07
  • Sorry, that comment was meant to say that some cables will NOT work with Nexus 7, in Windows or Linux. Recent versions of Ubuntu connect to Nexus and other androids with no problems, so you can disregard my comment. – NoBugs Jan 21 '14 at 04:16
  • Try this https://android.stackexchange.com/a/237117/350426 –  May 15 '21 at 13:56

7 Answers7

37

You have to follow a below procedure to share contents between Ubuntu to Nexus 7.

Install the necessary tools using terminal.

sudo apt-get install mtp-tools mtpfs 

Connect your Galaxy Nexus to your computer. On your phone, open up the notification drawer, and click on “USB Connection type”. Make sure that MTP is selected.

Type these commands in terminal:

mtp-detect | grep idVendor
mtp-detect | grep idProduct

The output of these commands should give you idVendor and idProduct. Note down the values given, as you'll need them later.

Run this command in terminal:

gksu gedit /etc/udev/rules.d/51-android.rules

A Gedit window should open. Simply Copy and paste below line.

SUBSYSTEM=="usb", ATTR{idVendor}=="VENDORID", ATTR{idProduct}=="PRODUCTID", MODE="0666"

Replace VENDORID and PRODUCTID with the idVendor and idProduct you had noted down earlier in Gedit.

Save and close the file. Then, disconnect your phone and run these commands:

sudo service udev restart
sudo mkdir /media/GalaxyNexus
sudo chmod a+rwx /media/GalaxyNexus
sudo adduser YOURUSERNAME fuse

Replace YOURUSERNAME with your Ubuntu user name. Now, run this command:

gksu gedit /etc/fuse.conf

In the Gedit window, remove the # at the beginning of the last line.

You’re almost done! Now, restart your computer, and then run these three commands:

echo "alias android-connect=\"mtpfs -o allow_other /media/GalaxyNexus\"" >> ~/.bashrc
echo "alias android-disconnect=\"fusermount -u /media/GalaxyNexus\"" >> ~/.bashrc
source ~/.bashrc

Again, do re-type the quotes in each command after you’ve copied, otherwise the command won’t work.

Connect your phone again, and then make sure your phone is using MTP, then run this command:

android-connect

You will able to connect the Nexus 7 your to your Ubuntu computer.

KK Patel
  • 19,083
  • 1
    This works perfectly, although when I add the last three commands with new quotes as you said, the source ~/.bashrc prompt me that there is no such aliases. – gotqn Oct 30 '12 at 22:11
  • 2
    It works but data transfer is very slow. It also takes quite long (1 min) till Nexus device gets mounted. Is it a problem of my configuration or it's a general issue with mtp on Nexus ? – tommyk Nov 04 '12 at 12:28
  • @tommyk I think this depends by your computer configuration - I have transfer a HD film larger then 3 GB for about a minute. – gotqn Dec 13 '12 at 10:28
  • 1
    I recommend changing out of both echo to echo [...] >> ~/.bash_aliases and for grant final accordingly source ~/.bash_aliases as a comment in bashrcstates: "You may want to put all your additions into a separate file like ~/.bash_aliases, instead of adding them here directly." – nuala Jan 05 '13 at 02:16
  • It worked flawessly for me. – Esteban Knöbl Jan 25 '13 at 19:24
  • It's incredibly slow for me as well. Transfer speeds around 264 bytes/sec to my Nexus 4. – Kerrick Feb 07 '13 at 07:25
  • On Ubuntu 12.10, this was very slow, both to connect and to transfer. – Drew Noakes Apr 21 '13 at 23:05
  • 1
    You should use 12.04 LTS version. It's very stable. – KK Patel Apr 22 '13 at 03:26
  • @K.KPatel Not working on 12.10, I did exactly as you mentioned above the only thing I changed was the GalaxyNexus name for Nexus7, and I can't see any of the device data. Any thoughts on how to fix it. – JesusLives ii May 06 '13 at 23:48
  • "mtp-detect | grep idVendor" doesn't output anything. How to fix? – emeraldhieu Jun 08 '14 at 04:01
12

I have found that the easiest way to transfer files is using the app called AirDroid. You'll need your laptop & the android device to be connected to the same network though.

Steps

  1. Install airdroid on Android device

  2. launch the app , if the Android device and laptop on same network it will automatiocally
    detect the computer IP and ask to Enter the generated pin on Android device on computer web address which is http://web.airdroid.com/

  3. Paste data on your computer on a particular folder say Download in this case
  4. On Android device access your folder via shown second tab named Tools
Seth
  • 58,122
Subh
  • 121
12

You can simply switch the Nexus 7 into Camera (PTP) mode under Storage / USB Connection.

Eliah Kagan
  • 117,780
Dalen
  • 121
  • Good idea, but doesn't work... Windows or Linux. – NoBugs Dec 26 '13 at 21:12
  • This worked for me, but with latest/greatest Android on the Nexus 7, the configuration is buried under Configuration -> System -> Developer Options -> Select USB Configuration -> PTP – Dustin Kirkland Dec 06 '16 at 22:40
9

For my personal use, I've used instructions similar to those that @K.K Patel provided in their answer.

However, some users either do not want to, or are uncomfortable with using the command line. For them, I recommend using AirDroid.

This solution does not require any configuration on the Ubuntu systems.

All that is needed is an application installed on the Android phone, a shared wireless connection between the phone and Ubuntu system, and a web browser on the machine running Ubuntu.

On the Android phone, follow these steps:

  1. Go to this link: https://play.google.com/store/apps/details?id=com.sand.airdroid&hl=en

    or:

    • Start the Google Play application
    • Search for AirDroid
  2. Install the AirDroid application
  3. Start the AirDroid application on the phone The AirDroid application will provide a URL to connect to as well as a QR confirmation code. Make note of these two bits of information.

On the Ubuntu system, follow these steps:

  1. Start a web browser.
  2. Enter URL provided by AirDroid from the phone (i.e. 198.168.1.4:9100(substitute the actual IP address and port number here))
  3. The user will be prompted for a login. Use the QR code provided by the phone. You can also choose to connect via https for a more secure connection.

After logging in, a 'desktop' will be presented, through the web browser, to communicate with your Android phone:

This provides a simple method of transferring files, photos, updating contacts, etc. between the Android phone and Ubuntu system.

Seth
  • 58,122
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
5

You want to install gvfs-mtp because this is the absolute easiest and most comfortable way.

sudo add-apt-repository ppa:langdalepl/gvfs-mtp

sudo apt-get update && sudo apt-get dist-upgrade

sudo reboot

Have fun.

1

gMtp is an mtp based application provides a gui interface to connect with the device.

All that is needed is to intall libusb-dev, mtp libraries and gmtp. This link provides information about this

http://www.humans-enabled.com/2011/12/how-to-fix-samsung-galaxy-nexus-mtp.html

You don't even need to compile libmtp from source as discussed in the write-up. I used synaptic and selected all the required packages and got the whole thing running instantly.

This might be easier if one doesn't want to go and mess with udev scripts.

Prarobo
  • 160
1

After struggling with this for a while, and finding all the above solutions failing (mtpfs had errors, gmtp crashes and is really slow, airdroid also slow) this worked great:

https://github.com/hanwen/go-mtpfs

Brian
  • 11