GPII Android Building
Running GPII Demos on Android
The information from this page is outdated and doesn't include the current way of building the GPII on Android. If you're looking for an updated information about building the GPII for Android you should go to the official build instructions.
Super Quick Summary
- Get the Android toolchain from Google
- Clone the GPII Android repository
- Run a shell script to set up the build environment
- Run the Ant script that is provided in our repository
- Run a command to install the built .apk onto the device
- Run another command to copy all GPII code onto an SD card
- Run another command to start the system
Rooting and Special Privileges
Rooting the phone is an optional step. The functionality available to you will depend on whether or not you root the phone and install the GPII package in a privileged directory. Here are the three possible scenarios you can choose from:
- If you want to only configure third-party apps such as FreeSpeech, you don't need to root the phone
- If you want to set built-in settings such as font size, you need to root the phone
- To stop and start core services such as Talkback and Brailleback, you need System Privileges. In that case, you can manually install the GPII .apk into the /system/apps directory (There are GUI tools to help with this, described below)
We can use a pre built node apk to get started quickly with running the GPII on Android. Please note this is all very alpha, please don't use it on the mobile you use for making calls.
First, grab our current prebuilt Node APK and install it:
curl -O https://github.com/sgithens/gpii-android-test/raw/master/AnodeActivity.apk adb install AnodeActivity.apk
Second, clone the android git repo and run the build script
mkdir gpii cd gpii git clone email@example.com:GPII/android.git cd android ./build.sh
Third, transfer the files, replacing '/sdcard' with your preferred file location on the device. Because the universal repo contains some symlinks (which 'adb push' doesn't support), we zip it up. You can also use whatever development method you prefer for working with files on the device. (ssh, etc)
cd .. adb shell mkdir /sdcard/gpii tar -c android node_modules > gpii.tar adb push gpii.tar /sdcard/gpii/gpii.tar adb shell 'cd /sdcard/gpii; tar -xvf gpii.tar'
Lastly, we can now start up node and run the gpii.
adb shell am start -a org.meshpoint.anode.MAIN adb shell am broadcast -a org.meshpoint.anode.START -e cmdline /sdcard/gpii/android/gpii.js adb logcat # You should see the standard GPII logging, and our server started on port 8081
WSIS 2013 / Google I/O 2013 Demo Install
A snapshot of binaries used for our early Summer 2013 demos is available as well. These include demos for starting/talking Talkback, setting the fontsize, and launching Free Speech.
Installation is similar to the above (you will need the same tools and skill sets), with a few caveats.
First, grab the prebuilt APK.
curl -O https://github.com/sgithens/gpii-android-test/raw/master/GoogleIOAnodeActivity.apk
You can install it as in the above instructions with "adb install", but in order to start/stop Talkback we need to install it in to the "/system/app" folder. An easy way to do this is to install an Android File Manager such as "ES File Explorer" (available on Google Play, and other places). Using ES File Explorer you can do the following:
- Open the sidebar and go to: Root Explorer
- In Root Explorer you can then select: Mount R/W
- Mount /system as RW
- Then copy the APK from the /sdcard directory or elsewhere to /system/app
- Restart the device, and our Anode will be running as system
You don't *have* to install it in system if you don't need to demo talkback.
After installing the demo APK, fetch the following and use adb push to copy it to the device similar to above.
curl -O https://github.com/sgithens/gpii-android-test/raw/master/gpii-googleio.tar.gz adb push gpii-googleio.tar.gz /sdcard/gpii-googleio.tar.gz adb shell 'cd /sdcard/; tar -xzvf gpii-googleio.tar.gz'
Also install Tony Atkins Free Speech app from Google Play or his site.
With this installed, we have 3 demo personas for special use on Android:
- paulina : Starts/stops Talkback
- wayne : Start Free Speech
- maguro / gert : Increases/Decreases Fontsize
Building Node and All
This uses several Android build toolchains, and until we have automated the build scripts will require a fair amount of existing Android experience to run the build. To build the entire stack from scratch you will need have *both* the Android SDK and Android NDK installed.
The overall build process is as follows:
- Clone the usual Github repositories as usual
- Build a number of C/C++ native modules using the Android NDK
- Build the Anode/GPII APK using the Android SDK
- Include GPII specific modules and install everything on to the phone
These steps are literally for building the entire stack, including node.js itself from scratch. Once we reach a certain level of stability, we will make binary builds of the lower level steps available, and the entire APK itself, so GPII users can program in declarative JSON as usual.