> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/get-started/get-started/cordova/shared-cordova.md).

# Integrating Cordova PDF Library with Android

Integrate the Apryse Native Plugin for Android applications using Cordova with this step-by-step guide. Get a free trial with unlimited usage and support. Explore React Native or Flutter for cross-pla

## This project is no longer in development. If you are looking for cross-platform solution, check out [React Native](https://github.com/ApryseSDK/pdftron-react-native/) or [Flutter](https://github.com/ApryseSDK/pdftron-flutter/). If you are looking to add to your current Cordova/Ionic project, check out the [WebViewer sample](https://github.com/ApryseSDK/webviewer-cordova-sample/).

This guide will help you integrate a free trial of the Apryse Native Plugin for Android applications using Cordova. Your free trial includes unlimited trial usage and support from solution engineers.

{% hint style="info" %}
**See here for the get started guide for using the Apryse Cordova Native Plugin on iOS.**
{% endhint %}

**Note:** There are other approaches that can be used to integrate Apryse technology with Cordova. Please see [this FAQ page](/ios/guides/cordova/pdftron-ionic-cordova-options.md) to find out more about the relative strengths of each approach.

## Prerequisites

* [Node.js](https://nodejs.org/en/) and [npm](https://www.npmjs.com/get-npm/)
* [Cordova CLI](https://cordova.apache.org/docs/en/latest/guide/cli/#installing-the-cordova-cli)
* [Android Studio](https://developer.android.com/studio/)

{% hint style="warning" %}
**The Eclipse IDE is not supported.**
{% endhint %}

## Setup

If you don't already have a Cordova codebase, start one. If you do, then make sure Android is added as a platform and skip to integration.

1. Create a new Cordova project called `pdfhello`

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
cordova create pdfhello com.example.pdf pdfhello

 cd pdfhello
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Add Android as a platform to build the Cordova application for.

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
cordova platform add android
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Integrate Apryse Native Plugin into your Cordova Application

1. Add the `pdftron-cordova` plugin in your project directory.

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
cordova plugin add https://github.com:PDFTron/pdftron-cordova.git
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Navigate to `pdfhello/platforms/android` and add the following line in the `gradle.properties file`:Key can be left empty for a trial

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
PDFTRON_LICENSE_KEY=INSERT_COMMERCIAL_LICENSE_KEY_HERE_AFTER_PURCHASE
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Navigate to `pdfhello/platforms/android/app/main/` and open `AndroidManifest.xml` with your favorite text editor.Change the activity theme to `CustomAppTheme`:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
-<activity android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar">
+<activity android:name="MainActivity" android:theme="@style/CustomAppTheme">
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Navigate to `pdfhello/platforms/android/app/main/com/example/pdf/` and open `MainActivity.java` with your favorite text editor. Change the base class for the main activity from `CordovaActivity` to `CordovaAppCompatActivity`:

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
-public class MainActivity extends CordovaActivity {
+public class MainActivity extends CordovaAppCompatActivity {
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Next step

<a href="/android/get-started/get-started/cordova/view-a-document.md" class="button primary">View a document</a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/get-started/get-started/cordova/shared-cordova.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
