HowTo Build


The following build instructions are intended for a linux based OS. My build system is Ubuntu 11.10 (both 32-bit and 64-bit should work). You need to have the following development tools for i686 or x64 installed:

  • gcc, g++, make, openjdk-6-jdk, patch, subversion, autoconf, automake, tar, bzip2, gzip, libc6-dev

In order to build phoneME for Android, you need to first compile Android itself to get all the required native libraries. You can get the sources and the toolchain from the Android source code repository. I can also recommend using the agcc wrapper script to simplify the build process.

Download the Java SE Development Kit 1.4.2_19 for Linux and unpack it (as root) to /opt:

# chmod a+x /path/to/j2sdk-1_4_2_19-linux-i586.bin
# cd /opt
# /path/to/j2sdk-1_4_2_19-linux-i586.bin

Download the phoneME sources

Check out phoneME from the subversion repository with this script: checkout

mkdir -p /tmp/phoneme
cd /tmp/phoneme

svn checkout legal --username guest
for i in javacall pcsl midp cdc tools jpeg abstractions xmlparser restricted_crypto jsr172; do
      svn checkout$i/trunk $i --username guest

Make sure you have about 600 MB of space available in /tmp before your run the script:

# cd /tmp
# sh /path/to/checkout

Apply the patches

The builds in the Downloads section were made after compiling with the following changes:

Note that not all the change sets in the diff are mandatory. There is still some code in there that is used for testing purposes. Also, there is some tweaking with the MIDP graphics to get a nice look and feel on a 800x480 display and the dragging feature was disabled for smoother interaction. There are several other quick hacks in there that probably need a more appropriate fix.

Apply it as follows:

# cd /tmp/phoneme
# patch -p1

Build the software

Use the following script to create a PhoneME Advanced - Foundation Profile build:

export CVM_TARGET_TOOLS_PREFIX=/opt/android/toolchain/gcc-4.4.3/bin/arm-android-
export GNU_TOOLS_DIR=/opt/android/toolchain/gcc-4.4.3/arm-android
export WORK_DIR=$PWD
export JAVA_HOME=/opt/j2sdk1.4.2_19
export CVM_PRELOAD_LIB=true
export JAVAME_LEGAL_DIR=$PWD/legal
export CVM_DEBUG=false
export CVM_JIT=true
export USE_AAPCS=true
export J2ME_CLASSLIB=foundation
export CVM_PRELOAD_LIB=true
export TOOLS_DIR=$WORK_DIR/tools

echo "CVM_TARGET_TOOLS_PREFIX=$CVM_TARGET_TOOLS_PREFIX" >> cdc/build/linux-arm-generic/GNUmakefile

rm -rf tools/output
cd cdc/build/linux-arm-generic
make -f GNUmakefile bin VERBOSE_BUILD=true USE_VERBOSE_MAKE=true $@

And run it in /tmp/phoneme:

# cd /tmp/phoneme
# sh /path/to/build | tee build.log

If the compilation succeeds, you can find the binaries zipped together into an archive located in the /tmp/phoneme/cdc/install/ directory.

Upload the files in this directory to your Android device (e.g. using adb) in /data/local/tmp. You could then try to run the test application on your Android device within a shell environment (e.g. with adb shell):

# bin/cvm -cp Test