问题
There are many posts about reading .docx files with Apache POI on Android. I write Java program, which do it and want move it Android platform. But XWPFDocument requires xmlbeans.jar, and xmlbeans.jar requires stax-api.jar. And Stax API can not be added to android app, because it tries to extends javax.* namespace, which is not allowed.
So question is: how can I satisfy dependencies for Apache POI on Android?
回答1:
There are now at least two projects which try to solve most of the problems when using Apache POI on Android. Only some methods when handling images will still fail because Apache POI uses stuff form java.awt which Android does not have.
Take a look at
- https://github.com/andruhon/android5xlsx
- https://github.com/centic9/poi-on-android/ (mainted by me)
The first one is currently based on POI 3.12, whereas the second can be re-compiled with newer versions of POI more easily.
回答2:
Long investigation shown, it is not possible to use Apache POI on Android platform for editing .docx files.
来源:https://stackoverflow.com/questions/24442758/how-to-satisfy-dependencies-for-apache-poi-on-android