How to satisfy dependencies for Apache POI on Android?

无人久伴 提交于 2019-11-27 08:04:06

问题


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

  1. https://github.com/andruhon/android5xlsx
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!