Create PDFium on Android

I have a problem. I need to add PDF reader support to my Android application (now I use Mupdf, but I need to change it).

I found the PDFium project ( https://code.google.com/p/pdfium/ ) and I think this is what I need for my needs.
I do not have much experience in Android, and I could not create it for Android, I followed the assembly instructions here https://code.google.com/p/pdfium/wiki/Build without good results.

Could you give some hint or advice for creating this tool in Android?

Thanks in advance!

+5
source share
2 answers

Build it in AOSP
https://android.googlesource.com/platform/external/pdfium/
Use mm or mma commands to create only pdfium file

I only successfully created a shared library, but I do not put it into practice.

+2
source

How to build?

I recommend building on Linux (enough virtual machine), because Windows is not officially supported, and there are many problems in newer versions of OS X.

You will need about 60 GB of free space.

  • install OpenJDK 8
  • $ mkdir ~/android_src && cd ~/android_src or select any other path
  • $ repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r28

    (detailed description is available here )

  • $ repo sync and wait ...
  • clone this repo (or download a zip with its contents)
  • replace make files in ~/android_src with corresponding make files from this repo
  • $ cd ~/android_src
  • $ source build/envsetup.sh
  • $ cd external/pdfium/fpdfsdk
  • $ lunch and select architecture
  • $ mma and wait ~ 5 minutes Library
  • available in ~/android_src/out/target/product/generic*/obj/lib/libmod*.so , copy it somewhere
  • $ rm -r ~/android_src/out before the next build

This worked for me, but if that doesn't work, try installing the additional packages listed here .

A source

0
source

Source: https://habr.com/ru/post/1205371/


All Articles