Hacking away with Android pt 1 – using the file system, WiFi and FTP

Brief

In the past days I have been testing several options with my Android Devices to see if I can move them beyond their general purpose. It is a preparation towards three types of use:

Using Android Tablets as an alternative for a Netbook – including the use of an external keyboard, external storage, and an external mouse

Using Android devices (like tablets, hand helds and phones) as distributed computers – each fulfilling a specific task and each capable of communicating to the others and sharing and transferring files

Using a chain of Android Devices as the “Smart Part” of Roomware installations – allowing Arduino devices and XBee-based devices to become connected to an Application Pool that can extend the local setup to a global installation.

The Archos 7 Android Tablet | Android 1.6– While waiting on the newer models to hit the market, this one is nice to start with

My MacBook Pro with Windows installed via VMware

Main issues that led to this article

I am testing the possibilities of the Archos line of Android tablets. I want to install applications that allow me to edit Office documents and add more value to the Tablet as a possible “Netbook” computer. I also have 2 other Android devices with which I am experimenting in different setups.

I can not download Android Market files on my Archos – as it does not have the Market installed.

I want to be able to make “distribution packages” – containing a collection of Andorid APKs to do specific things

I want to be able to distribute these packages fast and simple – to multiple devices

My motives are somewhat nerdish. There is no clear purpose except for wanting to do this because “all other” methods (including connecting the phone via USB to the computer and using the Android SDK) are too much fuss or rendered to be “stupid”.

Discussed in this article

The following things have been investigated and will be discussed in this article:

Rooting the Android device – Necessary for some things (like file access to the “data” folder from outside and Tethering) nice for others (browsing the root folders and copying APK files – the Android Executable files – to the SD card, enabling me to distribute them to my other devices)

Using the device as an FTP Server – useful to transfer files to- and from the Android device, especially when working with multiple Android devices

Fixing your IP number – Once you hook your device in the WiFi network and start communicating to it, it is nice to have a fixed IP number to refer to.

Installing an FTP Client – useful to directly communicate to other Android Devices and move files from one to another

Installing a Web Server – useful to run sites, or directly manipulate stuff on your Android device via a web interface when it allows you to run Java Beans

Installing an WebDAV server – Similar to using the device as an FTP Server, with the added value that you can use your file-explorer to browse folders and transfer files between your computer and the device

Testing several file browsers – to manage and transfer files on the local system

Throwing stuff around between Android Devices – using a laptop, SD-cards and several Android Devices to share applications and files

Launch applications after boot – Defining which applications will automatically be started when the Android device is booted

1: Rooting the Android device

Universal Androot

Rooting the Android device is simple for most Android phones. In my case I tested it for the Archos7 and the LG G540, using Universal Androot. The G540 roots beautifully. The Archos7 does not root at all, apparently due to a Archos-specific build of the Android OS.

Not all devices have access to the Android Market – Tablets in particular are excluded, while the applications you like to distribute and share can – in most cases – only be downloaded via the Android Market.

I want to distribute applications downloaded from the Android Market from one device to another – This is possible by using Root Explorer (see further below), your SD-card and an FTP Client / Server solution

2: Using the device as an FTP Server

SwiFTP

When you install an FTP server on your Android Device, you make the file system of that device accessible via WiFi. The benefits and uses are these:

No USB connection needed for file transfer – You can directly access the Android device via FTP and transfer files to and from your machines via WiFi

3: Fixing your IP number

When you make your IP number fixed, your device will connect via that IP number any time it connects to that specific WiFi network. The benefits are these:

The IP address of your device remains unchanged – Even when you disconnect and reconnect, your device will be issued the same IP address

Easy access via pre-defined connection settings – You can setup the connections to your Android Device using a fixed number.

Easy access and communication between your devices – Once each of your devices has a fixed number, you can easily swap files between each other, or do more advanced stuff with Roomware or other real time systesm (more about that in a later post).

Where Android offers you to force a fixed IP-number in a WiFi network, this is for all networks. As you might be a guest in someone elses network, forcing your IP number also on their system, I find it more polite to do it on a network per network basis.

WiFi Static takes your current WiFi network and allows you to configure the IP-number you want to use for your device. This configuration is per network and automatically kicks in when your device connects to the WiFi.

4: Installing an FTP-client

andFTP

Once you have fixed your IP-number, using an FTP-client between your devices becomes an interesting option. In my case I tested this using an Archos7 tablet and a Android phone, where the phone is rooted and the tablet is running in normal mode.

Using the FTP-client and the fixed IP-address, connecting to the phone is done by selecting it from the profile.

As I have Root-access to the phone, I can copy the files I downloaded, put them on a place sharable to other machines and transfer them via FTP on my Archos7 SD card.

FTP clients tested:

FtpCafe (1.99 pound for full version) by Dragan Andric – a good looking FTP client, using one tab for local and one tab for remote folders

AndFTP ($3.99 for full version) by LyseSoft – a more straight forward FTP client, following the same design patterns as FtpCafe

5: Installing a Web Server

Paw Server

The limited capacities of your Android device (memory, performance, storage) does not make it into a suitable web server to run your websites from. But when you are hacking the Android, installing a Web Server on your Android Device suddenly starts to make sense for the following reasons:

Access to functionalities on the phone – Anything running on the phone can be made accessible (in theory) via a web interface. Including:

Reading status logs from the device – like the status of the hardware, events happened (doors opened and closed) and so on

Manipulating connected hardware – like Arduino and XBee devices and other hardware you have (written) controllers for

Exposing remote controls – like “open door / close door” or showing specific data on specific screens (think shops here, where you can see what they sell, using your phone and the browser on your phone to run through their catalog)

I found the following Webservers capable of running applets:

I-Jetty – “A port of the popular Jetty open-source web container to run on the Android mobile device platform.” – very hard to make work with your own stuff.

PAW Server by Fun2Code – A full blown web-server using BeanShell that allows you to run your own Java beans and is automatically started when your Android device is started

I have not tested these two web servers yet, so no experiences available yet on what you can do with them and your Android device.

My current preference goes to PAW Server, for the use of BeanShell, which seems to offer a very simple and straight forward way to run your Java Apps on the background.

6: Installing a WebDAV server

Dav Drive

WebDAV is supported by both Windows and Mac OS. It allows you to open a direct File-browser based channel to your Android Device and with that the possibility to open multiple sessions to multiple devices and drag and drop files from one to the other.

I found and tested the following applications:

WebSharing by NextApp – A paid application (US$ 2.99) if you want to use WebDAV

DavDrive by Fun2Code – A free application offering you enough configuration options to do what you need

Automated start of WebDAV sharing not possible (yet) – Sharing via DAV needs to be started manually for both applications, once they are running, making automatic startup and availability of WebDAV access to your devices not possible yet. This might also be something I overlooked.

[Update]

The commercial version of DavDrive does allow for auto-start

7: Testing several File Browsers

Root Explorer

There are several tastes in File Browsers for Android. I looked at the following properties:

Easy drag and drop

Root

Easy file manipulation

Easy to share over- / working on multiple devices (as the Archos does not allow access to the Android Market without hacking)

Scali Commander

With the sharing as the main filter, the following two applications have been tested:

Root Explorer by Speed Software (2.50 pound)- Allows multiple-file select, very effective for moving and copying files from one to another folder. Can be moved to other devices

ScaliCommander by Gnslngr (0.99 euro) – Offers a 2 pane list, one with the “source” items and one with the “destination” items. Does not work with Root.

Others like File Expert (nice looking, FTP upload options, does not use the possibilities of Rooting), ES File Explorer (does not use the possibilities of Rooting) and the Japanese “Super Manager” does not use the possibilities of Rooting) have not been tested yet.

8: Throwing stuff around between Android devices

At this point in time, I have only looked at manual file transfers. Automated transfers and synchronizations are not tested yet.

To make file transfer easy between your Android Devices (taken that they live in the same WiFi network, the following steps are to be taken:

Fix the IP-address of your Android device within your local WiFi (WiFi Static does that job for you)

Install and run a FTP Server (SwiFTP does the job very well)

Install and run an FTP client (AndFTP is currently used by me, File Expert might be another option)

Define the Android FTP-servers you want to communicate to – using the fixed IP-addresses of each device to be able to connect again the next time

Run a File Browser with Root Access (Root Explorer does a good job) if you want to also transfer files from the “/data” folder from your phone

Share the files from your device on your SD card

I currently use either a PC or the Archos7 and Archos 32 (acting as a USB host and with mouse and keyboard connected) for the more extensive actions.

Conclusion

This post hopefully gave you some insight in the options you have with the Android Devices (including phones and tablets) to go beyond the basic: “watch a movie, browse a website, listen to some music” type of use.

Later posts

In later posts I will go into specific uses and show you how to use the Archos7 tablet as a “Netbook”, by connecting a keyboard and mouse via a USB hub and running a simple Office Suite allowing you to create, open and edit Word and Excel files on your Android device.

I will also release a new Android Roomware Client / Server in due time allowing you to share sensor data (including those from your phone) between devices within your WiFi network.

[…] I was able to do FTP transfers using AndFTP (FTP client) and SwiFTP (FTP server) between the Android devices I have and between Android devices and my laptop. Read more about that software in part one. […]