|
1 |
| -This project builds native JNI code and Java bindings for Android. |
| 1 | +# MuPDF Android Fitz |
| 2 | + |
| 3 | +This project builds the MuPDF Java bindings for Android. |
| 4 | + |
| 5 | +These bindings provide low level access to the MuPDF library using a handful of |
| 6 | +simple Java classes. The API is very similar to the one used by the `mutool |
| 7 | +run` JavaScript bindings. |
| 8 | + |
| 9 | +## License |
| 10 | + |
| 11 | +MuPDF is Copyright (c) 2006-2017 Artifex Software, Inc. |
| 12 | + |
| 13 | +This program is free software: you can redistribute it and/or modify it under |
| 14 | +the terms of the GNU Affero General Public License as published by the Free |
| 15 | +Software Foundation, either version 3 of the License, or (at your option) any |
| 16 | +later version. |
| 17 | + |
| 18 | +This program is distributed in the hope that it will be useful, but WITHOUT ANY |
| 19 | +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 20 | +PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 21 | + |
| 22 | +You should have received a copy of the GNU Affero General Public License along |
| 23 | +with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | + |
| 25 | +## Prerequisites |
| 26 | + |
| 27 | +You need a working Android development environment, consisting of the Android |
| 28 | +SKD and the Android NDK. The easiest way is to use Android Studio to download |
| 29 | +and install the SDK and NDK. |
| 30 | + |
| 31 | +You also need GNU make and a working C compiler in order to auto-generate some |
| 32 | +files during the build step. |
| 33 | + |
| 34 | +## Building |
| 35 | + |
| 36 | +Download the project *recursively* using Git. Note that it is VERY important to |
| 37 | +use the recursive option, in order to also check out the libmupdf submodule and |
| 38 | +its submodules. |
| 39 | + |
| 40 | + $ git clone --recursive git://git.ghostscript.com/mupdf-android-fitz.git |
| 41 | + |
| 42 | +Run the make generate step in libmupdf. |
| 43 | + |
| 44 | + $ make -C libmupdf generate |
| 45 | + |
| 46 | +Edit the local.properties file to point to your Android SDK directory: |
| 47 | + |
| 48 | + $ echo sdk.dir=$HOME/Android/Sdk > local.properties |
| 49 | + |
| 50 | +If all tools have been installed as per the prerequisites, build the app using |
| 51 | +the gradle wrapper: |
| 52 | + |
| 53 | + $ ./gradlew assembleRelease |
| 54 | + |
| 55 | +If all has gone well you should now have an android AAR library in |
| 56 | +build/outputs/aar/mupdf-android-fitz-release.aar. |
| 57 | + |
| 58 | +## Maven |
| 59 | + |
| 60 | +The default is to create the Maven artifact in the 'MAVEN' directory. You can |
| 61 | +copy those files to the distribution site manually, or you can change the |
| 62 | +uploadArchives repository in build.gradle before running the uploadArchives |
| 63 | +task. |
| 64 | + |
| 65 | + $ ./gradlew uploadArchives |
| 66 | + |
| 67 | +You can then copy the artifact files to where you want them: |
| 68 | + |
| 69 | + $ rsync -av MAVEN/ com.example.maven:public_html/maven/ |
| 70 | + |
| 71 | +## Reporting Bugs |
| 72 | + |
| 73 | +The MuPDF developers can be contacted on IRC in the #mupdf channel on |
| 74 | +irc.freenode.net. |
| 75 | + |
| 76 | +Report bugs on http://bugs.ghostscript.com/ with "MuPDF" as the product, "apps" |
| 77 | +as the component, and "Android" as the OS. If you are reporting a problem with |
| 78 | +a specific file, please include the file as an attachment. |
0 commit comments