Archive for April, 2009

Greenstone3 Goes Mobile, Ported to Android Platform

admin. Wednesday, April 1st, 2009.

Would you like to have a Greenstone3 server in your pocket? Now you can with our port of the run-time system to Android. Fire-up Greenstone3 on your mobile phone and then access it just like any other Greenstone server, searching and browsing multimedia collections. You can connect to it over a wi-fi network, an ad-hoc wireless network (device-to-device) or via a USB cable.

You may have read about our earlier success in porting Greenstone2 to Apple devices. We have Greenstone2 running on early (3rd to 5th generation) iPods (see details of our demo) and the iPod Touch (see our paper here). Now Greenstone3, our next-generation digital library software, runs on a mobile handset.

Specifically, it runs on an HTC G1 Android-powered mobile phone. Android is a project of the Open Handset Alliance, and is an open platform for mobile devices.

How does it work?

Collections are built on a desktop computer in the same way as with standard Greenstone3. It is the runtime code that we have ported.

Greenstone3 conventionally runs as web-application of a Tomcat web server. However, it’s not tied to Tomcat, and can be used with an alternative web server such as Jetty . Of course, these and other desktop web servers aren’t going to run on a mobile device. Fortunately the people at Webtide have created i-jetty , a port of Jetty to Android, which solved our mobile web server requirements.

Greenstone3 is written in Java, as are Android applications. Normally though, Greenstone3 uses mg++ for indexing and GDBM as its database. Unfortunately both are written in C/C++ which isn’t much help when a totally Java runtime is needed. However, Greenstone3 supports the use of Lucene (indexing) and JDBM (database), both of which are Java. Using these we can build collections such that only Java is required for a fully functional Greenstone3 server.

However Android Java isn’t exactly the same as desktop Java, so some modification of the Greenstone3 runtime source code was required. This mainly relates to as yet unimplemented aspects of Android Java and its limited supported for XML processing. Some workarounds were required because of the limited memory (192Mb RAM) and processor power (528MHz) available on an actual handset.

The runtime is compiled into a JAR file. This and other necessary Java libraries, along with the standard Greenstone3 ‘web’ directory (which includes the collections) is organised into an i-jetty web application directory structure. i-jetty provides a utility to combine this into a WAR file, with Java classes converted into the byte code required by the virtual machine running on the Android device. This is then transferred to the SD card on the phone.

i-jetty is then launched on the phone with Greenstone3 available as a web application and accessible from a web browser by specifying the phone’s IP address and the webapp context as the URL.

At the moment the code is in pre-alpha release state. It works but needs some further debugging and optimization. When it’s ready we’ll make it available separately from the standard Greenstone3 distribution but eventually we’ll integrate it to the Greenstone3 package.

Any enquiries, technical or otherwise, should be sent to [email protected].

Acknowledgement: purchase of the G1 handset was supported by the ICT Science Kudos Award 2008.