On this page
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.
- Import the "Examples" project on Android Studio.
- Open the
AndroidManifest.xml
file located in thesrc/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>
- In the toolbar, select "PDFViewer" from the run configurations drop-down menu.
- From the target device drop-down menu, select the device that you want to run "PDFViewer" on.
- 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.
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.