This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
kawa.repl on Android
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Sat, 14 Jul 2012 17:38:39 +0200
- Subject: kawa.repl on Android
Here is a way to run Kawa on Android without creating a GUI app:
1. shell> configure --with-android
2. shell> make
3. shell> dx --dex --output=k.dex kawa-1.12.1.jar
4. shell> adb shell mkdir -p /mnt/sdcard/data/kawa/
5. shell> adb push k.dex /mnt/sdcard/data/kawa/
6. shell> adb shell
7. adb> cd /mnt/sdcard/data/kawa/
8. adb> export ANDROID_DATA=/mnt/sdcard/data/kawa/
9. adb> dalvikvm -cp k.dex kawa.repl -s
Essentially we convert the Kawa jar to a dex file, copy it to the
device, and use dalvikvm to execute it.
The dx and adb tools are part of the Android SDK and are in
$(ANDROID_SDK)/platform-tools. Step 8 tells dalvikvm where to put its
cache directory.
The error output stream on Android seems to be buffered, so
(force-output (current-error-port)) may be useful sometimes.
Helmut