[23883] | 1 |
|
---|
| 2 | Greenstone3 Runtime on Android
|
---|
| 3 | ==============================
|
---|
| 4 |
|
---|
| 5 | This extension helps you set up and run Greenstone3 on your android device.
|
---|
| 6 |
|
---|
| 7 | It relies on the environment variable ANDROID_SDK_HOME to determine
|
---|
[23970] | 8 | where the Android SDK lives on your file system, in a similar way
|
---|
| 9 | JAVA_HOME gets used by many programs to determin where Java is
|
---|
| 10 | installed on a particular computer. The key programs we need to run
|
---|
| 11 | from the Android SDK are 'adb' and 'dex'. The most straight forward
|
---|
| 12 | way to control this variable is to:
|
---|
[23883] | 13 |
|
---|
[23970] | 14 | cp setup-android.bash.in setup-android.bash
|
---|
| 15 |
|
---|
| 16 | and then edit 'setup-android.bash' the value of **ANDROID-SDK-HOME**
|
---|
| 17 | to be the top-level directory of where the Android SDK was installed to.
|
---|
| 18 |
|
---|
| 19 | Having done this, source the main setup file:
|
---|
| 20 |
|
---|
| 21 | source setup.bash
|
---|
| 22 |
|
---|
| 23 | which automatically sources setup-android.bash if the ANDROID_SDK_HOME
|
---|
| 24 | environment variable isn't set.
|
---|
| 25 |
|
---|
[23883] | 26 | Having sourced the setup file the two main steps are:
|
---|
| 27 |
|
---|
| 28 | 1) Install i-jetty
|
---|
| 29 |
|
---|
| 30 | 2) Install Greenstone3 as a web-app
|
---|
| 31 | (converting any jar and class files to DEX format)
|
---|
| 32 |
|
---|
| 33 | The first step typically only needs to be done once. The second step is
|
---|
| 34 | composed of three sub-steps, and may require the last two sub-steps to
|
---|
[23970] | 35 | be repeated if the Java code has been modified.
|
---|
[23883] | 36 |
|
---|
| 37 | Step 1
|
---|
| 38 | =======
|
---|
| 39 |
|
---|
| 40 | First, install i-jetty on your Android device. You can do this through
|
---|
| 41 | the Market, or else type:
|
---|
| 42 |
|
---|
| 43 | adb install i-jetty-2.2-signed.apk
|
---|
| 44 |
|
---|
| 45 | Note: for your Android device to install applications using 'adb' you
|
---|
| 46 | need to have enabled it's application 'Development' mode (under
|
---|
| 47 | Settings->Application)
|
---|
| 48 |
|
---|
[23970] | 49 | *************
|
---|
| 50 | **Important**
|
---|
| 51 | *************
|
---|
[23883] | 52 |
|
---|
[23970] | 53 | Having installed i-jetty, find the application on the Android device
|
---|
| 54 | and launch it (but you don't have to go as far as starting the i-jetty
|
---|
| 55 | server from within this application). Launching i-jetty completes the
|
---|
| 56 | installation of the application by creating the 'jetty' folder on the
|
---|
| 57 | Android's SD-card, and populating it with the default configuration
|
---|
| 58 | files for i-jetty. The 'jetty' folder is needed for your setup procedure
|
---|
| 59 | as it is where Greenstone-3 will be installed to.
|
---|
| 60 |
|
---|
| 61 |
|
---|
[23883] | 62 | Step 2
|
---|
| 63 | ======
|
---|
| 64 |
|
---|
| 65 | Next put your Android device into USB disk mode, and set up the necessary files
|
---|
| 66 | to run Greenstone3 as a web-app under i-jetty. The three sub-steps are:
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 | Step 2.1
|
---|
| 70 | --------
|
---|
| 71 |
|
---|
| 72 | Transfer the bulk of the <GSDL3SRCHOME>/web structure to the
|
---|
| 73 | <SDCARD>/ijetty/webapps/greenstone3 with:
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | WEBAPP-ROOT-TO-SDCARD.sh
|
---|
| 77 |
|
---|
| 78 | This script skips any .svn files if present. It also skips installing
|
---|
| 79 | 'localsite' as this is rather large -- both in size and in terms of
|
---|
| 80 | the number of files invovled -- so copying is rather slow, and it is
|
---|
| 81 | probably not what you want anyway.
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 | Step 2.2
|
---|
| 85 | --------
|
---|
| 86 |
|
---|
| 87 | Convert the class files (includes those stored in jar files) into
|
---|
| 88 | classs.dex with:
|
---|
| 89 |
|
---|
| 90 | JAVA-TO-DEX.sh
|
---|
| 91 |
|
---|
| 92 | The finished file, which is also by this point zipped up, is left in
|
---|
| 93 | the 'lib' folder.
|
---|
| 94 |
|
---|
| 95 |
|
---|
| 96 | Step 2.3
|
---|
| 97 | --------
|
---|
| 98 |
|
---|
| 99 | Copy classes.zip onto the Android's sd-card
|
---|
| 100 |
|
---|
| 101 | DEX-TO-SDCARD.sh
|
---|
| 102 |
|
---|
| 103 | This is the final step in getting Greenstone3 setup on an Andoird.
|
---|
| 104 | Switch off the USB disk mode on the Android device. Note: it can take
|
---|
| 105 | a device minute or two "preparing" the sd-card. This can be seen
|
---|
| 106 | on the notification view. Alternativey, if you try to start i-jetty
|
---|
| 107 | before the card is ready, then i-jetty points this out, and offers you
|
---|
| 108 | a 'retry' button.
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 | Step 3
|
---|
| 112 | ======
|
---|
| 113 |
|
---|
| 114 | Launch i-jetty from my apps area. Then, within i-jetty, start the
|
---|
| 115 | server. Once the "Jetty started" message appears, switch to your
|
---|
| 116 | web-browser application. We've tested the built-in web browser, and
|
---|
| 117 | Mobile Firefox 4.
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | If the Java code to Greenstone3 is changed, then you need to repeat sub-steps
|
---|
| 121 | 2.2 and 2.3
|
---|
| 122 |
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | Caveats:
|
---|
| 126 | ========
|
---|
| 127 |
|
---|
| 128 | 1. Due to difficulties in getting MG and MGPP working on android
|
---|
| 129 | through the NDK, these are currently not supported. Effectively,
|
---|
| 130 | the Greenstone3 used needs to be one compiled *without* JNI
|
---|
| 131 | support.
|
---|
| 132 |
|
---|
| 133 |
|
---|
| 134 | 2. Due to a runtime (reflection) error, we had to modify xalan.jar.
|
---|
| 135 | The modified version of this file is also in the 'jars' folder
|
---|
| 136 | used in this extension.
|
---|
| 137 |
|
---|
| 138 |
|
---|
| 139 |
|
---|
| 140 |
|
---|
| 141 |
|
---|