summaryrefslogtreecommitdiff
path: root/src/ui/android/README
diff options
context:
space:
mode:
authorbringert <bringert@google.com>2013-10-04 16:26:46 +0000
committerbringert <bringert@google.com>2013-10-04 16:26:46 +0000
commita35b286ce040919a71d27e5bf696886237c6c470 (patch)
tree4e54cc1994a7f0760f76b0efe8c9e85ef38ec9ef /src/ui/android/README
parentf156a5e8f9c903f132541e1c34f1c9f5c1ee69af (diff)
Add new Android voice translator sample app
This adds a simple voice translator Android app that uses the JNI bindings to the PGF C runtime. Caveats: - Since the C runtime doesn't compile for Android right now, I've bundled an old copy, along with its Java bindings. That should be removed once the C runtime compiels for Android again. - Adding an automated build would be nice. - Replacing the grammar requires editing a Java file, that should really be more dynamic.
Diffstat (limited to 'src/ui/android/README')
-rw-r--r--src/ui/android/README66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/ui/android/README b/src/ui/android/README
new file mode 100644
index 000000000..1d3bda521
--- /dev/null
+++ b/src/ui/android/README
@@ -0,0 +1,66 @@
+= Overview =
+
+This directory contains a sample Android app tht uses
+the Android speech recognition and TTS APIs along with
+JNI bindings to the C PGF runtime to implement a simple
+speech translation app.
+
+
+= Requirements =
+
+1. Android SDK: http://developer.android.com/sdk/
+ installed in $ANDROID_SDK_LOCATION
+
+2. Android NDK: http://developer.android.com/tools/sdk/ndk/
+ installed in $ANDROID_NDK_LOCATION
+
+= Building =
+
+Set up Android project:
+
+# Creates local.properties, not to be checked in
+$ $ANDROID_SDK_LOCATION/tools/android update project -p .
+
+Build libs/libjpgf.jar:
+
+$ (cd ../../runtime/java && javac org/grammaticalframework/pgf/*.java && jar -cf libjpgf.jar org/grammaticalframework/pgf/*.class)
+$ cp ../../runtime/java/libjpgf.jar libs
+
+Build JNI code:
+
+$ cd jni
+$ $ANDROID_NDK_LOCATION/ndk-build
+
+
+Build APK:
+
+$ ant debug
+
+
+Install on your device:
+
+$ ant debug install
+
+or:
+
+$ adb install -r bin/MainActivity-debug.apk
+
+
+= Changing the grammar =
+
+1. Replace assets/ResourceDemo.pgf
+
+2. Edit Translator.java to point to the new file and include its metadata
+
+
+= Developing in Eclipse =
+
+1. Install Android ADT
+
+2. Eclipse > File > Import > Existing Projects into Workspace > Next
+
+3. Select root directory...
+
+4. Select GF/src/ui/android
+
+5. Finish \ No newline at end of file