How to build MuPDF for Android

Set up an Android build environment

Download and install the Android SDK. Run the android tool to install the platform tools. Add the tools and platform-tools directories inside the SDK directory to your PATH.

Download and install the Android NDK (r6 or later). Use the 32-bit target NDK if targeting a 32-bit platform! Add the NDK directory to your PATH.

Make sure you have both JDK and ANT installed.

You will also need git and a regular development environment (gcc and gnu make).

Prepare the source

Check out a copy of the mupdf android viewer source from git:

~/src $ git clone --recursive git://

Build and debug

Edit the local properties configuration file.

~/src/mupdf-android-viewer $ cp
~/src/mupdf-android-viewer $ nano

Prepare the auto-generated files:

~/src/mupdf-android-viewer $ make -C libmupdf generate

Build the native code libraries:

~/src/mupdf-android-viewer $ ndk-build

Build the java application:

~/src/mupdf-android-viewer $ ant debug

Install the app on the device or emulator:

~/src/mupdf-android-viewer $ ant debug install

Copy some files onto the device for the app to read:

~/src/mupdf-android-viewer $ adb push .../file.pdf /mnt/sdcard/Download/file.pdf

To see debug messages from the emulator:

~/src/mupdf-android-viewer $ adb logcat

Good luck!