Smartphones

Connect to Samba shares from Android with AndSMB

AndSMB is a free app that allows you to connect an Android device to a Samba share. Jack Wallen shows Android users how easy it is to install and configure AndSMB.

I am a big fan of the Android platform, and I am a big fan of the Linux platform, so it makes sense that I would like it when the two can meet in the middle. Samba makes this possible. That's right... Samba is the incredibly handy tool that allows Linux to share out folders to other operating systems.

In order to connect to a Samba share from an Android device, you must use third-party software. One of the best apps I have found for this purpose is AndSMB (for Android SMB). AndSMB allows an Android device to connect and share files with a Samba share or a shared Windows directory. It's simple to install and easy to set up. Let's walk through the process of installation and connection with AndSMB. (AndSMB requires Android 1.0 and up.)

Installing AndSMB

The installation process of AndSMB is simple:

  1. Open the Android Market.
  2. Search for "smb" (no quotes).
  3. Select the entry for AndSMB and tap Install.

Now you'll find the app in the Application Drawer of your Android device.

Setting up a connection

When AndSMB is fired up, the application will present a window where connections can be created, edited, and more (Figure A). Unless the address of the Samba server is a publicly accessible address, the Android device will need to be connected to the same network the Samba server is on by wireless, VPN, or both. Figure A

The drop-down allows for quick selection of connections and can hold as many connections as needed.
In order to set up the connection between the Android device and the Samba share, this is the information you'll need (Figure B):
  • Hostname: The hostname or IP address of the Samba machine.
  • Username: The username associated with the Samba share.
  • Password: The password necessary to authenticate against the Samba share.
  • Domain: If the Samba machine (or user) requires authentication through a Domain, this will be necessary.
  • Local dir: The directory on the Android device used to save files to.
  • Remote dir: The share to be connected to.
Figure B

If your Samba server is set up to allow anonymous connections, you should have a chat with the administrator about why that is a bad idea.
In the Advanced tab (Figure C), you can configure these options:
  • Charset: Select from UTF-8, Shift-JIS, CP1251, and some other select character sets.
  • Port: If the Samba server uses a non-standard port, set it here.
  • WINS Srv: If a WINS server is required for your Samba connection, configure it here.
  • Bdcast addr: Most Samba connections won't need to configure a broadcast address, but if it is necessary, it can be configured here.
  • LMHosts: If the Samba server requires Lan Manager Host for domain name resolution, the option can be configured here.
  • Printer: If there are any printers shared on the Samba server, define the printer to be used here.
Figure C

Note the required restart if you attach a printer to the server settings.
After the connection is configured and saved, the Main window will appear again. Select the desired Samba connection from the drop-down and then click the Connect button. The connection should be authenticated fairly quickly, and AndSMB will present a listing of files and folders on the share (Figure D). Figure D

To disconnect from a share, click the Disconnect button, and you're done. To download a file, tap the file(s) to be downloaded and then tap the Download button. The files will be downloaded to the directory configured as the "Local dir" option in the connection setup.

Sending files

AndSMB isn't limited to downloading from the Samba server; with this handy Samba tool, files can also be sent to the server. To do this, follow these steps:

  1. Connect to the Samba server using AndSMB.
  2. Once the connection is made, tap the Device file browser button.
  3. Navigate to the directory containing the file to be sent.
  4. Tap the file to be sent.
  5. Tap the Menu button.
  6. Tap the More button.
  7. Tap Send.
  8. Select AndSMB from the list.
  9. Select the Samba connection to send the file to (Figure E).
  10. Click OK.
  11. Once the file finishes sending, click OK.

Figure E

Select the Samba share to send to from this listing.

The sent files will be in the root directory of the configured Samba share.

Summary

If you are looking for a way to connect an Android device to a Samba share, you will be hard-pressed to find a better solution than AndSMB. Not only is AndSMB simple to use, it's also reliable, fast, and free.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

1 comments
jackdagnon
jackdagnon

Is there not a way to indicate what directory you want the files from Windows to go to when downloading . I know there is a local directory in the one time setup, however I may be downloading Mp3 one time and next documents. I would like to pick at time of download the directory I would like the files to end up in. Thanks Jack