Networking

Host sites and share files via the kWS Android web server

kWS is a mobile web server that can serve up files or a web site from your Android device. Here's how to install and run kWS.

Do you know that from your Android phone you can host a web site and share files while you're on the go without emailing the files? Both of these tasks are possible with the help of the tiny kWS web server from Xeus Technologies.

Image credit: Xeus Technologies

kWS is incredibly easy to install, and it takes very few CPU cycles. Here's how to get the kWS server installed and running on your Android-based mobile device.

Installation

Follow these steps:

  1. Open up the Android Market tool.
  2. Search for kws.
  3. Install the application.

The web server is now installed and ready to run.

Starting the application/server

The first thing to do is open your applications window (where this is will depend upon the phone you are using) and fire up the kWS application. In the default screen, you will see a button at the bottom of the window marked Start Server; if you want to dive in, go ahead and hit that button. If you do hit the Start Server button, you will see a log file fly by. Within that log file you will see lines like, [24-Aug-2010 12:52:38] http://IP_ADDRESS:8080, where IP_ADDRESS is the actual IP address of your phone.

You can then fire up a browser, point it to that IP address, and see what you have on the server. More than likely, you will not see anything. If you see FORBIDDEN: NO directory listing, this means you have not enabled directory listing on your server, and there is no index file on your document root. If you want to enable directory listings, follow these steps:

  1. With kWS open, click the Menu button.
  2. Click the Settings icon.
  3. Enable Directory listing.

When you do this, and you reload the web page, you should see a listing of the directories and files on the server.

Create your mobile web site

To serve up a web site on your phone, you need to install a text editor in order to write the HTML; a good editor for this purpose is TxtPad Lite. You could also create the pages on your machine, mount your phone, copy the files to the SD card on the phone, and then point your browser to the phone. Make sure you create an index.html page to serve as the launch pad for your web site.

If you are so inclined, you can also set up authentication for kWS. To do this, go back to the Menu and click Settings and then scroll down until you see Authentication. In the Authentication section, you have three options:

  • Authentication: Select the type you want (None, Basic, Digest).
  • Username: Create the username for authentication.
  • Password: Create a password for authentication.

The above is especially critical if you plan on serving up any sort of sensitive data, or you are concerned with any data on your phone slipping into the wrong hands.

Image credit: Xeus Technologies

DNS

If you won't want to have to remember your IP address, you can always take advantage of a service such as dynDNS or no-ip.com so that you (and others) can reach your phone. When you do, make sure you configure this within the kWS settings. If you do configure it on your phone, you are sure to get your IP address updated if it should change on your phone.

Battery life, CPU drain

I was really quite surprised that kWS does not drain your battery or hit your CPU too hard. Although, if for some reason your little mobile web world starts getting a ton of hits, you can bet your battery will drain and your CPU will spike.

Final thoughts

The practical application of this is not obvious. But there are those of us who like to flex our geek muscles (I, for one, find joy in this), we do it because we can. I bet that if you really dig deep, you will find a reason to host a web server on your Android phone.

What do you think? Is there a reason to serve up "mobile you" to the world? If so, why?

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.

Editor's Picks