Greenstone3 Runtime on Android ============================== This extension helps you set up and run Greenstone3 on your android device. It relies on the environment variable ANDROID_SDK_HOME to determine where the Android SDK lives on your file system, in a similar way JAVA_HOME gets used by many programs to determin where Java is installed on a particular computer. The key programs we need to run from the Android SDK are 'adb' and 'dex'. The most straight forward way to control this variable is to: cp setup-android.bash.in setup-android.bash and then edit 'setup-android.bash' the value of **ANDROID-SDK-HOME** to be the top-level directory of where the Android SDK was installed to. Having done this, source the main setup file: source setup.bash which automatically sources setup-android.bash if the ANDROID_SDK_HOME environment variable isn't set. Having sourced the setup file the two main steps are: 1) Install i-jetty 2) Install Greenstone3 as a web-app (converting any jar and class files to DEX format) The first step typically only needs to be done once. The second step is composed of three sub-steps, and may require the last two sub-steps to be repeated if the Java code has been modified. Step 1 ======= First, install i-jetty on your Android device. You can do this through the Market, or else type: adb install i-jetty-3.1-signed-aligned.apk Note: for your Android device to install applications using 'adb' you need to have enabled it's application 'Development' mode (under Settings->Application) ************* **Important** ************* Having installed i-jetty, find the application on the Android device and launch it (but you don't have to go as far as starting the i-jetty server from within this application). Launching i-jetty completes the installation of the application by creating the 'jetty' folder on the Android's SD-card, and populating it with the default configuration files for i-jetty. The 'jetty' folder is needed for your setup procedure as it is where Greenstone-3 will be installed to. Step 2 ====== Next put your Android device into USB disk mode, and set up the necessary files to run Greenstone3 as a web-app under i-jetty. The three sub-steps are: Step 2.1 -------- Transfer the bulk of the /web structure to the /ijetty/webapps/greenstone3 with: WEBAPP-ROOT-TO-SDCARD.sh This script skips any .svn files if present. It also skips installing 'localsite' as this is rather large -- both in size and in terms of the number of files invovled -- so copying is rather slow, and it is probably not what you want anyway. Step 2.2 -------- Convert the class files (includes those stored in jar files) into classs.dex with: JAVA-TO-DEX.sh The finished file, which is also by this point zipped up, is left in the 'lib' folder. Step 2.3 -------- Copy classes.zip onto the Android's sd-card DEX-TO-SDCARD.sh This is the final step in getting Greenstone3 setup on an Andoird. Switch off the USB disk mode on the Android device. Note: it can take a device minute or two "preparing" the sd-card. This can be seen on the notification view. Alternativey, if you try to start i-jetty before the card is ready, then i-jetty points this out, and offers you a 'retry' button. Step 3 ====== Launch i-jetty from my apps area. Then, within i-jetty, start the server. Once the "Jetty started" message appears, switch to your web-browser application. We've tested the built-in web browser, and Mobile Firefox 4. If the Java code to Greenstone3 is changed, then you need to repeat sub-steps 2.2 and 2.3 Caveats: ======== 1. Due to difficulties in getting MG and MGPP working on android through the NDK, these are currently not supported. Effectively, the Greenstone3 used needs to be one compiled *without* JNI support. 2. Due to a runtime (reflection) error, we had to modify xalan.jar. The modified version of this file is also in the 'jars' folder used in this extension.