Android: convierta documentos, páginas docx y xls, hojas xlsx a html utilizando apache POI

Estoy desarrollando una aplicación para Android. En el que quiero mostrar los archivos doc, docx, xlx, xlsx en mi aplicación.

Después de buscar en google, llegué a saber que el PDI de apachi convertirá estos archivos en html. Para que haya agregado el"poi-3.8-20120326.jar" en la carpeta libs e intente compilar la aplicación. Pero me enfrenté a un problema de construcción dalvik.

Entonces, busqué sobre este problema y descubrí que el jar POI es compatible con aplicaciones java que no son totalmente compatibles con Android.

Tengo un código abierto para convertir ppt, archivos pptx.https://github.com/qhm123/POI-Android

En estos códigos fuente, descargaron el código fuente de apache poi y agregaron la fuente en la aplicación y la usaron para convertir los archivos ppt, pptx.

Así que he usado el siguiente código para doc, páginas docx a html.

WordToHtmlConverter.main(new String[]{"/sdcard/office/sample.doc", "/sdcard/office/sample.html"});

Para esto, he agregado el paquete "org.apache.poi.hwpf" en mi proyecto de aplicación. Pero obtuve el mismo problema de compilación dalvik que mencioné anteriormente. Entonces no pude construir la aplicación.

Entonces, ¿cómo puedo hacer esto usando Apache POI?

Error de Dalvik:

[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$4) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$5) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$6) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:27 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.ControlPanel$7) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:28 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.Main$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:28 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.chainsaw.MyTableModel$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.util.LogFileParser$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LF5SwingUtils$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogBrokerMonitor$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogBrokerMonitor$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogBrokerMonitor$4) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogFactor5ErrorDialog$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogFactor5InputDialog$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.LogFactor5InputDialog$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.categoryexplorer.CategoryExplorerModel$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.categoryexplorer.CategoryExplorerTree$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:29 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:30 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.xml.DOMConfigurator$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:38 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:38 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.SimpleLog$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:38 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.WeakHashtable$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:38 - POI-operations] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.WeakHashtable$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-12-01 13:55:50 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
[2014-12-01 13:55:50 - POI-operations] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

Respuestas a la pregunta(0)

Su respuesta a la pregunta