Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I'm looking for an SMB Server app for my HTC Hero (Android 2.1) so I can share the contents of my SD card and phone memory over the WiFi network like a regular Windows file share. I'd like one that does not require me to root my phone, and am willing to pay for the right app so it doesn't have to be free.

All I've found so far are:

  1. SambaAndroid which requires root access.
  2. androidsmb which is a "Java implementation of the SMB/CIFS network file and printer share server for Android devices" hosted on Google Code that has no documentation and has not released any files.

Is it even technically possible to develop an SMB Server on Android that can be installed without root access?

share|improve this question
    
I've used Wifi Explorer (appbrain.com/app/wifi-file-explorer/…) a few times and it works great, no root required. It's not SMB, though (and is probably not FTP, either). –  Joe Casadonte Sep 29 '10 at 18:06
add comment

6 Answers

up vote 7 down vote accepted

As your original question still isn't answered and I wondered the same, here's the answer.

Short answer: No, without root it's not possible to run an SMB server using the default ports so that it's found by Windows PCs.

Long answer: SMB either runs on ports 137-139 (UDP and TCP) using NetBIOS or on newer systems (from Windows Vista onwards) directly on TCP port 445 where in the latter case computer names are resolved by the LLMNR (Link-local Multicast Name Resolution) protocol which runs on UDP port 5355. Why is this important? Apps not running as root can't bind to unprivileged ports (<1024). It's possible to use alternative ports for SMB but Windows is hard-wired to just listen to the default ones. So I guess if you use Linux or a separate SMB client for Windows which allows to connect to a server with a custom port number it's probably possible. But it's not really a straight-forward way.

share|improve this answer
    
Great an actual answer after all this time. Thanks. Now if only I could remember why I needed this... ;) –  Day May 8 '12 at 14:52
    
Well, I wanted it because I'm too lazy to plug the USB in to access the SD card :D –  neo May 8 '12 at 18:23
add comment

I may be misunderstanding but it sounds like you need an SMB client, not a server. Also, you do not need root access. To use SMB to tranfer files to you computer you can use ASTRO File Manager with the SMB addon, or there's File Expert which is also free.

You could also use WebDAV instead of SMB with an app like WebSharing.

In the past I used an app that with client software on my computer allowed me to transfer files through the file explorer from anywhere through the web. It wasn't a full VNC app. I got a new phone and now for the life of me I can't find the app.

share|improve this answer
    
Hi thanks for the answer, I really wanted a server on the phone so that my (Ubuntu) PC can push new files onto it when I get home without me having to even take the phone out of my pocket. Prefer to not require additional software on PC, but of course an FTP or WebDAV server on the phone would also meet that requirement, so it looks like File Expert will do the job. I'm installing now will report back thanks –  Day Sep 29 '10 at 7:54
    
Hmmm the FTP server doesn't seem to work - the Ubuntu "Connect to Server" wizard says "unexpected end of stream". Have to go to work, will try again later ta. –  Day Sep 29 '10 at 8:03
    
No it does work... my fault for rushing. That should do the job nicely thanks. –  Day Sep 29 '10 at 20:53
add comment

Alternatively, you could run a ftp server on your phone to get access to your SD card's content. Check out SwiFTP.

share|improve this answer
    
I second SwiFTP. You won't be able to take any files off the phone using it without being root, but it should work fine for the SD card. –  Webs Sep 29 '10 at 12:57
add comment

While it may not be possible to run an SMB server without root, it is possible to run a WebDAV server without root for a similar effect.

Setting up an Android WebDAV server

On my stock Nexus 7, I installed WebDAV Server, opened it, clicked on the start button and was immediately able to see my /storage/sdcard folder in my web browser at the URL displayed by the application, i.e. http://192.168.x.y:8080

Note that with WebDAV, you also have the option of selecting Root (/) or DCIM as well as SdCard as the WebDAV root.

Using the WebDAV server through Windows Explorer

I then mapped http://192.168.x.y:8080 as a network drive in Windows Explorer and could the access the contents of my storage drive, just as if I was connected via MTP, but through a drive letter.

Sadly, this solution is incredibly slow.

Every directory change takes between 6 and 20 seconds, as does accessing most files. Once a file is accessed though, it transfers at a reasonable speed (copying a single 42MB file in Windows Explorer took around 60 seconds, so 700KB/s).

Thus WebDAV via Windows Explorer is Ok for downloading a few large files whose location you know, but browsing or syncing a whole device this way isn't quick. I synced 1.75GB of data in around 6000 files and 400 directories and it took 10 hours, i.e. around 50KB/s or 10 files/dirs per minute on average.

Using the WebDAV server through Windows command line

Even from the command line, each directory listing takes 5-6 seconds, as does any file access. Copying the same 42MB file from the command line took around 20 seconds, so around 2.1MB/s.

Using the WebDAV server through a web browser

The fastest option for WebDAV is to use your web browser though, directly through the URL given. Changing directory rarely takes more than a second and downloading the same 42MB file from the command line took around 12 seconds, so around 3.6MB/s.

The downside of using the web browser is that it only shows the date (no size or type) and makes no distinction between files and directories so if a file doesn't have an extension (or a directory does) then it may not be obvious if clicking on a link will take you to another web page (for a directory) or start a download (for a file).

Caveats

  • By default, Windows limits the size of WebDAV downloads to 50000000 bytes (47.6MB), though this can be changed through a registry hack (FileSizeLimitInBytes in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters) if you know what you are doing.

  • WebDAV access is not secure. Even if you set a password on the WebDAV share, the connection is still http not https, so it is not encrypted. Only use WebDAV on a secure wifi network and certainly don't enable the WebDAV server while you are in an internet cafe or other unsecured wifi.

share|improve this answer
add comment

The issue is not he samba server, but the fact that Windows can access a samba share only on port 445, and on a non-rooted android a normal App can't listen on port 445.

But you can overcome this with some TCP port-mapping:

  1. Install a samba server on your android, and make it listen on a port like 7777
  2. Install a TCP port-forwarding software somewhere (I installed it on a virtualPC)
  3. Setup the portmapping software to listen for connections on port 445, and forward the connections to your android on port 7777
  4. Now you can access the shared folder on this virtualPC, and you'll get the data from the samba server installed on android (trough the portmapping)

I've described all the steps in detail here on my blog http://techforpassion.blogspot.it/2013/12/android-how-to-share-folder-over-wifi.html

I've tried different samba server, and the only free app that works in this configuration is called Samba Server

share|improve this answer
add comment

droid NAS works well enough. pretty sure that's an smb server?

share|improve this answer
    
That requires root access, because SMB uses ports in the restricted range (1-1024). In the "Droid NAS" app description, they say "Windows is NOT supported because it can't connect to SMB servers via a non-standard port." –  Stephen Schrauger yesterday
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.