Wednesday, November 6, 2013
2:46 AM

Connect Android and Linux using USB

I have a Samsung Galaxy Tab 2 tablet, running Android 4.1.1 (aka Jelly Bean). I'd like to transfer some files from the tablet to my Linux server running Debian 7.2 (aka Wheezy). The Android tablet connects via Wi-Fi to the same LAN as the Linux server.

There are many ways to transfer files between the 2 devices. For example, you could install an Android app named AirDroid which lets you manage your Android device from a desktop web browser, including file transfer. In this post, I'll go another route, an arguably more direct and basic one. I'll connect the 2 using a USB cable.

  1. Connect the 2 devices using a USB cable.
  2. With the Android device, navigate to the home page.
  3. Swipe down from the top of the page.

    You will see a message "Connected as a media device. Touch for other USB options"

  4. Tap on the message.

    The resulting screen specifies how you want the Android device to connect: as a Media device(MTP) or a Camera (PTP).

    While Linux has some support for MTP, I found it much easier to connect as PTP.

  5. Tap on the Camera (PTP) checkbox.
  6. Swipe down from home page again, and you will see that the tablet is mounted as a camera.
  7. Reset the USB device under Linux.

    The simplest way is to unplug the USB cable from both ends, and plug it back in.

  8. Make sure that the Android device is mounted on your Linux server.

    On my Linux GNOME 3 desktop, I clicked on the Computer icon, and the Android device was detected (GT-P3113). Click the device to mount it.

  9. Run your favourite file manager application on Linux, and proceed to transfer files.

You can use the above method to transfer files if you happen to have (the right) USB cable around to connect the 2 devices. If cables is not your preference, you may want to look into the Android app Airdroid.

0 comments:

Post a Comment