HowTo Transfer Files Between Linux and Android Phone

In Android 2.2, we can just connect our computer to the phone's Wi-Fi hotspot directly without accessing a separate wireless network. The instruction below will describe the use of the phone's Wi-Fi hotspot although it is not required. (It is sufficient that your computer can access your phone through a network)

  1. On the Android phone, Select Menu > select Settings > select Wireless&networks
    Wireless&networks
  2. Select Tethering & portable hotspot
  3. Select the Portable Wi-Fi hotspot checkbox to share your data connection
    Tethering&portable hotspot
  4. If this is the first time the Wi-Fi hotspot is turned on, you should configure your phone's network SSID and password. To do that, select Portable Wi-Fi hotspot settings > select Configure Wi-Fi hotspot, then enter the values and save it.
  5. From Linux, assuming you are using NetworkManager, you can select your phone's network SSID and enter the password you have set earlier on your phone to connect to Internet via your phone's Wi-Fi hotspot. Subsequently, NetworkManager will by default auto-connect without requiring the password to be entered again.
    NetworkManager
  6. Open a terminal, and enter the route command to check your phone's IP address. In my case, the default gateway 192.168.43.1 for my wireless network interface (ra0) is my phone's IP address.

    lcm@skywind:~$ route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref   Use Iface
    192.168.43.0    *               255.255.255.0   U     2      0       0 ra0
    link-local      *               255.255.0.0     U     1000   0       0 ra0
    default         192.168.43.1    0.0.0.0         UG    0      0       0 ra0

  7. On your phone, download and install SwiFTP. It is FTP server for Android.
  8. Run SwiFTP. You will need to set the ftp user and password. By default, it listens on port 2121. SwiFTP
  9. Using the Linux Gnome File browser, select File menu > select Connect to Server menu, and then enter the ftp user, server and port. You can add the ftp connection as a bookmark so that you only need to enter the password subsequently.
    Connect to Server
    The File browser will prompt for the ftp user's password. Enter ftp password
    The File browser is displaying the Android phone's root folder. FileBrowser
  10. You can now use normal file operations: cut, copy, paste to transfer files between your phone and Linux. (If you prefer to use a Ftp client software, you can use that also.)

Comments

blog comments powered by Disqus