PDFlib PLOPDS for Android
=========================

This package contains a sample app demonstrating how to use PDFlib PLOPDS
on Android.

PDFlib PLOPDS for Android is a JNI wrapper around the native Android library
"libplop.so". To use PLOPDS you have to include the following files in your
application:

    sample_app/libs/armeabi/libplop.so
    sample_app/src/com/pdflib/PLOP.java
    sample_app/src/com/pdflib/PLOPException.java

and compile your application using the Android SDK (available at
http://developer.android.com/sdk/index.html)


The directory "PLOP_example" contains these files plus some additional
source modules which build a complete sample application. This application
is derived from the "dumper", encrypt and sign examples from the standard
PLOPDS distribution.

The directories "doc", "java", and "data" contain the documentation,
more java examples and data resources for the examples for PLOPDS.



Building the example PLOP_example assumes that the Android SDK is installed and
an AVD is set up correctly.

To run the sample it has to be installed on an Android emulator or device.
Also, you must place the input files PLOP-datasheet.pdf and demorsa2048.p12
from the data directory at the expected location as detailed below.


Here some short instructions:


Building the example from the command line
==========================================
    unpack the package
    cd PLOP_example
    android update project --name plop_examples --target 2 --path $PWD
    ant debug
    ant debug install

or import PLOP_example into Android Studio

Prepare device
--------------
    adb push ../data/PLOP-datasheet.pdf /data/data/com.pdflib/
    adb push ../data/demorsa2048.p12 /data/data/com.pdflib/

Launch the app on the device/emulator
-------------------------------------
    press the "run PLOP examples" button

Fetching results from the device
-----------------------------
    adb pull /data/data/com.pdflib/PLOP-datasheet-encrypted.pdf PLOP-datasheet-encrypted.pdf
    adb pull /data/data/com.pdflib/out-PLOP-datasheet.pdf out-PLOP-datasheet.pdf


Using the example from Eclipse with the ADT Plugin
==================================================
    Import the directory sample_app into an Eclipse workspace with
	"File", "Import", "Existing Projects into Workspace".
    In the DDMS perspective, copy the PLOP-datasheet.pdf file and the demorsa2048.p12
	resource to /data/data/com.pdflib/.
    Then right-click on the "PLOP_example" project and select
	"Run As", "Android Application" to start the application on an emulator.
    Finally you can fetch the result "PLOP-datasheet-encrypted.pdf" and
        "out-PLOP-datasheet.pdf" with the file explorer in the DDMS perspective.


Using the java samples
======================

    If you like to test other examples you may look to the java folder
    for other PLOP examples and modify the "plop_example.java" to
    your needs.

See also:

- doc/system-requirements.txt
- http://developer.android.com/guide/index.html
