I\'m trying to run pdfbox.jar library on Android and seems like I do everything right. I use Eclipse pluging to deploy the project. The code is very simple just call for pd
This one works perfectly! ;-)
Birdbrain2/PdfBox-Android
Had the same problem, and it solved it. Hope this helps!
Android does not include most of the java.awt.*
classes, and so third-party Java libraries that depend upon such classes would need to be rewritten to work on Android, or simply not used.
I can't use jars which are depend on jre libraries that dalvik doesn't know to use.
More accurately, you cannot use JARs which depend on classes that the Android SDK does not include.
The problem is due to the lack of AWT support in android, as others have indicated. A work-around for you could be to use the android port of PDFBox:
https://github.com/Birdbrain2/PdfBox-Android
tldr; replace your gradle dependency on PDFBox with this: org.apache:pdfbox-android:latest version here, and consider adding MultiDex support to your app if you get a DexIndexOverflowException exception.
The problem is that Android has minimal support for AWT.
This is one of those areas where it is clear that Android is NOT a Java platform. Android has its own stack for doing graphics and GUIs.
I'd like to know whether there is any solution ...
This SO question - Using awt with android - has an answer mentions a commercial product that allows you to run Swing code on Android. I don't know for sure, but I imagine that this product supports AWT as well.
The only part of AWT supported by Android is the fonts package.
Porting AWT graphics code to Android