Difference: BuildingAndroidMuPDFMobile (2 vs. 3)

Revision 32016-12-21 - RobinWatts

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Building the Android example

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

Changed:
<
<
get the latest code
git submodule update --init
make generate
>
>
  • 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.

Changed:
<
<
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
>
>
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
 
Changed:
<
<
Now build the old viewer, which produces libmupdf_java32.so. This library actually
contains both the old and new versions of the JNI interface.
>
>
Now build the old viewer, which produces libmupdf_java32.so. This library actually contains both the old and new versions of the JNI interface.
 
Changed:
<
<
cd mupdf/platform/android/viewer
ndk-build clean
ndk-build FZ_ENABLE_GPRF=1
>
>
  • cd mupdf/platform/android/viewer
  • ndk-build clean
  • ndk-build FZ_ENABLE_GPRF=1
  Copy the resulting file to the new example app:
Changed:
<
<
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/
>
>
  • 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/
Changed:
<
<
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.
>
>
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.
Changed:
<
<
Edit local.properties to point to the place where you've got the sdk and ndk installed.
For example, the stadard locations in OSX are
>
>
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:
 
Changed:
<
<
sdk.dir=/Applications/Android/sdk
ndk.dir=/Applications/Android/ndk
>
>
  • sdk.dir=/Applications/Android/sdk
  • ndk.dir=/Applications/Android/ndk
 
Changed:
<
<
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.
>
>
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
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc