Hi Yegor, the sample is not working. It shows the following exception,
07-28 15:17:27.308: ERROR/AndroidRuntime(5793): java.lang.ExceptionInInitializerError 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:151) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:136) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:54) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:98) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): Caused by: java.lang.NoClassDefFoundError: org.dom4j.Namespace 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): at org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller.<clinit>(PackagePropertiesUnmarshaller.java:49) 07-28 15:17:27.308: ERROR/AndroidRuntime(5793): ... 20 more I have to build POI only to read the document and display in android view not to write. But I think, the way i am doing now will not work. One more problem it is not finding the referenced files at runtime ...... When I refer the compiled ooxml-schema jar as reference file, android is not building dex file. and eclipse is giving heap space error becoz of 15mb jar file size. Do you have any other idea to build it for android? and one more think android does not support the javax.xml.stream and java.awt package. Regards, Jebarlin On Thu, Jul 28, 2011 at 3:09 PM, Yegor Kozlov <[email protected]> wrote: > There can be dozens of reasons. > > Does the OpenXml4J API work ? Can you open / save OPC packages? > > Try the following test on Android: > > OPCPackage pkg = OPCPackage.open("myfile.xlsx") > pkg.save("newfile.xlsx"); > > Yegor > > On Thu, Jul 28, 2011 at 12:51 PM, Jebarlin Robertson <[email protected]> > wrote: > > Hi Yegor, > > > > Actually I took all the source code of ooxml-schema1.1.jar, > xmlbeans.jar, > > dom4j.jar and I ported and compiled in android as a library, but anyway > it > > will not create the apk. I compiled by adding javax.xml.stream package , > > since android does not support some of the java APIs > > (javax.xml.stream.StreamReader , java.awt.). > > > > I referred these compiled source code (ooxml-schema1.1) in my android > > application, which is having Apache POI source code (scratchpad, ooxml, > > java), and I tried to parse one 2007 Word document, but it is giving the > > following exception > > > > 07-28 12:25:58.882: ERROR/AndroidRuntime(1372): java.lang.VerifyError: > > org.apache.poi.xwpf.usermodel.XWPFDocument > > > > > > But I am able to parse MS 2003 documents without this ooxml-schema.jar > and > > the ooxml files. > > > > > > > > > > Regards, > > Jebarlin Robertson.R > > > > > > > > On Thu, Jul 28, 2011 at 1:59 PM, Yegor Kozlov <[email protected]> > wrote: > > > >> the ooxml-schema.jar is 14 MB. I'm not sure that Android can swallow > that > >> big. > >> > >> How do you compile ooxml-schema.jar ? Does compile-ooxml-xsds task in > >> POI's build.xml work for you? What messages / exceptions are you > >> seeing? > >> > >> Yegor > >> > >> On Thu, Jul 28, 2011 at 12:01 PM, Jebarlin Robertson < > [email protected]> > >> wrote: > >> > Hi, > >> > > >> > > >> > I am trying to develop an application to view MS Office document in > >> android > >> > by using Apache POI. > >> > > >> > I could complete and parse the MS Office 2003 Document formats. > >> > > >> > But I am trying to port Apache POI into android for MS Office 2007 > >> format. > >> > > >> > I am unable to build the source code in android, because of the > >> > ooxml-schema.jar file. > >> > > >> > I tried to get the source code and build, but still it is not working. > >> > > >> > *Can anybody help me to build the apache POI for MS Office 2007 format > in > >> > Android?* > >> > > >> > > >> > -- > >> > Thanks & Regards, > >> > Jebarlin Robertson.R > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > > > > > -- > > Thanks & Regards, > > Jebarlin Robertson.R > > GSM: 91-9538106181. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Thanks & Regards, Jebarlin Robertson.R GSM: 91-9538106181.
