Monday, September 9, 2013

How to connect over Wi-Fi an Android device to a Windows PC mounting it as a local drive

There are lots of methods to connect an Android device to a PC for the file transferring over wi-fi; there are, for example, applications that runs an HTTP server on the device, so it can be accessed from the PC's web browser, and other applications that works as an FTP server to allow the user to access the device's content from the computer using an FTP client. But there is a trick that allows you to mount the device in a Windows PC making it recognize as a local drive, assigning it a letter exactly as happens with USB pen-drives.
The idea is to use an FTP server running on the device, but on the computer, instead using an FTP client, using NetDrive, a software for Windows that mounts FTP server as local drives (I had already talked about it here). In this tutorial I will explain how to set up it.

What you need

  • An FTP server app on your Android Device. I use ES File Manager, that is a great file manager that includes an FTP server; if you prefer something more lightweight you can choose from the lots of the FTP servers available on the Google Play Store. These apps usually don't require root privileges (unless you want to use a port number littler than 1024, but this is not necessary).
  • NetDrive installed on your PC. For personal/home use it's free and can be downloaded here; for commercial use, you need to buy a license.
  • The two devices being in the same subnet (for example, connected to your home router; this isn't really necessary, but if the devices were in two differents networks you would have to expose your Android device on the public Internet with a port forwarding rule, and it would be a bit dangerous).

Preparing the device

First of all, you need to set up the FTP server on the Android device. To do this, you have to open the app you installed and find the settings menu. In ES File Manager, you have to reach the server with a tap on the "Tools" voice in the left menu, then on "Remote access manager" and finally on the "Settings" button on the bottom of the screen. Here are some screenshots:
The main screen of the ES File Manager's built-in FTP server
The settings screen of the ES File Manager's built-in FTP server
These are the settings you need to care about:
  • Port: the server's port. The default should be OK; if you get errors saying this port is already in use, try to change it. You can use any number between 1024 and 65535.
  • Root directory: this is the top level directory you will be able to acces. The default value (usually "/sdcard") should make avaiable the whole device's internal storage accessible to the user; you can change it, for example, to access your external SD card, or, if you have root privileges, the protected archive.
  • Manage account: the credentials you will use to access the device from the PC.If you wants to protect your devices form unauthorized accesses (but don't worry, it would be possible only from inside your subnet), change the default values (they usually are "admin"/"admin").
Once completed the setup, you can start the server.

Preparing the PC

Now you have to set up NetDrive on your PC. When you start it, you will see this dialog:
To connect to your phone/tablet, click New site and configure the connection parameters in the right panel:
  • Site name: a name you will use to identify the device (for example, "My phone" or "My tablet").
  • Site IP or URL: the IP address of your device in your network. Usually it is indicated in the server app and is in the form 192.168.X.Y.
  • Port: the port you have chosen in the configuration of the server.
  • Server type: leave FTP (the other option is WebDAV, another protocol).
  • Drive: the drive letter which will be assigned to the device. You can choose any letter not already in use.
  • Account and password: the credentials you have chosen in the server configuration.
Now you can click Connect to mount the device as a local drive. Note: if at the first connection after its installation NetDrive reports an error, try to restart the computer (probably it's necessary because the virtual driver needs to be initialized at the startup of the system).
At the end, to disconnect, just click Disconnect in the NetDrive interface and stop the server on the device (usually it can be done with the same button used to start it).
If you have problems, probably I've explained badly the procedure, so leave a comment and I will try to improve this tutorial.
My NetDrive configuration...
... and the drive mounted.

No comments:

Post a Comment