create new tag
view all tags

Building the Android example

First do these steps, as you would do with any muPDF project:

  • get the latest code
  • git submodule update --init
  • make generate

Install Android Studio if you haven't already.

Install the latest Android SDK and NDK.

Obtain a copy of libgs.so, and place it in mupdf/platform/android/viewer/jni setting FZ_ENABLE_GPRF (below) enables use of this library

Now build the old viewer, which produces libmupdf_java32.so. This library actually contains both the old and new versions of the JNI interface.

  • cd mupdf/platform/android/viewer
  • ndk-build clean
  • ndk-build FZ_ENABLE_GPRF=1

Copy the resulting file to the new example app:

  • mkdir -p ../example/mupdf/libs/armeabi-v7a
  • rm -f ../example/mupdf/libs/armeabi-v7a/libmupdf_java32.so
  • cp ./libs/armeabi-v7a/libmupdf_java32.so ../example/mupdf/libs/armeabi-v7a/

Also put a copy of libgs.so in mupdf/platform/android/example/mupdf/libs/armeabi-v7a/

Open the example project in Android Studio. The first time you'll get a message about syncing the Gradle files, say OK to all of that.

If you see a message about "unregistered VCS root detected", choose Add Root. This will allow you to use git from inside AS.

Edit local.properties to point to the place where you've got the sdk and ndk installed. For example, the standard locations in OSX are:

  • sdk.dir=/Applications/Android/sdk
  • ndk.dir=/Applications/Android/ndk

At this point you can build the example in Android Studio. It may take a while and you might get asked about installing additional tools and SDKs along the way.

-- Fred Ross-Perry - 2016-12-21


Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2016-12-21 - FredRossPerry
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc