Skip to content
Guides

How to Run a Demo

ComPDFKit PDF SDK for Android provides multiple demos in Java for developers to learn how to call the SDK on Android. You can find them in the "Examples" folder. In this guide, we take "PDFViewer" as an example to show how to run it on Android.

  1. Import the "Examples" project on Android Studio.
  2. Open the AndroidManifest.xml file located in the src/main/ directory of the PDFViewer project and enter the ComPDFKit license information.
xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        ...>
  
    <!-- enter your ComPDFKit License -->
        <meta-data
            android:name="compdfkit_key"
            android:value="Your ComPDFKit Key" />

    </application>
</manifest>
  1. In the toolbar, select "PDFViewer" from the run configurations drop-down menu.
  2. From the target device drop-down menu, select the device that you want to run "PDFViewer" on.
  3. Click Run.

If you don't have any devices configured, then you need to either connect a device via USB or create an AVD to use the Android Emulator.

2.3

Note: This is a demo project, presenting completed ComPDFKit PDF SDK functions. The functions might be different based on the license you have purchased. Please check that the functions you choose work fine in this demo project.