Installation
Add the NexPDF Android AAR to a Gradle project from the release's Maven repository.
Download the SDK
From the v1.1.0 release, download one of:
| File | Contents |
|---|---|
nexpdf-android-1.1.0-maven.zip | A Maven repository on disk with com.nexdevit:nexpdf-android:1.1.0 |
nexpdf-android-1.1.0.aar | The AAR alone |
Unzip the Maven repository into your project, for example as nexpdf-maven/.
Add the repository and the dependency
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("nexpdf-maven") }
}
}dependencies {
implementation("com.nexdevit:nexpdf-android:1.1.0")
}To use the AAR file alone instead, copy it to app/libs/ and add
implementation(files("libs/nexpdf-android-1.1.0.aar")).
Check the minimum SDK
Set minSdk = 24 or higher. The AAR contains native libraries for arm64-v8a, armeabi-v7a and
x86_64; if you set ndk.abiFilters, keep to those.
Check the installation
import com.nexdevit.nexpdf.NexPdfJni
Log.i("NexPDF", "version " + NexPdfJni.version())What the AAR adds
- The native libraries
libnexpdf_ffi.so(the engine) andlibnexpdf_jni.so(the JNI bridge). - The
NexPdfReaderActivitydeclaration in the merged manifest (not exported). - Consumer keep rules for R8 and ProGuard that keep
NexPdfJni,NexPdfLicense,NexPdfReaderActivityandNexPdfUIConfig.
Bundle the license
Put nexpdf_license.xml in app/src/main/assets/, or the key in the manifest, as described in
License.
nexpdf_license.xml
AndroidManifest.xml
build.gradle.kts