Sunday, August 17, 2014

Turning an android device into a GIS workstation or server

Baseline: By installing Debian GIS on your phone/tablet/... next to Android, you can turn the device into a powerful GIS workstation or server without loosing any of the original functionality.

My experiments started earlier this week. I was informed of a bug in debian: saga gis failed to build on an arm processor (a type of low power chips often found in mobile devices). Rather than turning to some server provided by debian to fix the build I thought of doing something else: I knew my phone also has an arm processor. And since android is based on linux, I thought it should be possible to run debian on it in a seperate "chroot" environment.

After doing some research I found "debkit". This is actually an app you can install right through google play. This app will give some very simple instructions on how to install debian on your device (the device needs to be rooted. Otherwise it will not work). The actual instructions were very straightforward and I had a running debian installation with desktop support installed in less than one hour.

What you get is actually a full debian distribution, and in fact that means that you can also install a lot of GIS related packages.

Installing gdal through the command line

Since I was doing all of this on a smartphone, typing gets tedious very fast, so I used an external keyboard. And yes:  that looks really silly (check picture below). Even better is installing ssh, then you can connect from a pc or laptop to continue the installation.

attaching a keyboard makes typing easier :-)

You can even go one step further and install a graphical desktop environment, this means you can in fact run packages like qgis and saga on your phone. Though I agree that this is not very useful using a phone as a desktop replacement, it may be a powerful way to check some data or perhaps run a simple analysis in the field. Apart from that, plenty of tablets, cheap laptops and TV sets based on android or chrome os exist. Ones that you may prefer taking to the field rather than your real workstation. The screenshot below was taken from a desktop environment running on my phone. I should add that this works relatively smooth and was not stressing the device.
Hard to distinguish from a real desktop, but this is an actual screenshot taken on my smartphone (lenovo p780)


But perhaps even more useful is that you can actually run servers on the device as well. If you have a webapplication that usually runs on a debian server you may actually be able to take it with you on the device, and use the standard android browser to use it. Not something you would like as a proper solution, but could be worth it for proof or concepts, ...

Mapserver running locally and serving as a wms


It also shows nicely how you actually use debian next to android: you don't replace any existing things. It can lead to special situations as well. While I had just started compiling some software, I got a phonecall and just picked up the phone ...

All of this would not have been possible if all debian contributors would not have been so eager in supporting so many ports, and the debian gis team in bringing a lot of GIS software to the distribution!