2016-11-19 45 views
-1

我想阅读Android中的MS Word文件并获取内容文本,但阅读后我得到错误的字符。我试图使用Apache poi库,但应用程序无法编译,因为Apache Poi库有超过67k的方法。需要帮忙。无法读取Android中的MS Word文件

enter image description here

+1

应用程序可以编译。 https://developer.android.com/studio/build/multidex.html#about –

+0

提到这里, http://stackoverflow.com/questions/19422075/open-a-selected-file-image-pdf-programmatically-从我的android-applicat – Vijay

+0

@Vijay这个问题是PDF文件,而不是MS Word –

回答

0

最简单的方法恕我直言是端口的Apache POI库到Android。这是可能的,并有证据

移植POI,您可以将Word编辑功能嵌入到您的应用程序中。

像一段代码:如果你读到这里指点你的错误信息

Intent intent = new Intent(Intent.ACTION_EDIT); 
Uri uri = Uri.parse("file:///"+file.getAbsolutePath()); 
intent.setDataAndType(uri, "plain/text"); 
startActivity(intent);