Hi Dennis,

Thanks for this effort, it looks like a very interesting supplement to
the POI project.

If your hypothesis about the 65536 method limit is correct then the
problem is in the poi-ooxml-schema.jar, this is where compiled
XmlBeans for OOXML are stored. This file contains xml beans for all
OOXML modules - document, spreadsheet, presentation and common. In
short, poi-ooxml-schemas.jar is a truncated version of the full
ooxml-schemas.jar which contains only classes actually used in POI.
The criteria to put a xml bean in poi-ooxml-schemas.jar is whether it
is referenced in the ooxml test cases, that is, we run ooxml tests
against the full ooxml-schemas.jar, see what xml beans are loaded in
the junit class loader and copy those to the "light"
poi-ooxml-schemas.jar.
If you are interested only in the SpreadshetML beans then you can try
to make it smaller. The idea is to run only spreadsheetML tests. In
POI's buuld.xml there is a macro called ooxml-test-runner. You want to
modify it and run only tests for the "xlsf" module. The size of the
produced poi-ooxml-schema.jar will be smaller, hopefully below the
65536 method limit.


P.S. Would you like to put a reference to your project on the POI web
site? We can create  a "Related Project" section and put a reference
to android-spreadsheet there along with a short description. Questions
about POI on Android become common on the POI mailing lists and a link
on the POI web site may draw new contributors to your project. If you
are interested, we can work on that .

Regards,Yegor

On Mon, Oct 31, 2011 at 7:02 AM, Dennis Sheil <dsh...@vartmp.com> wrote:
> Hi,
>
> I wanted to see the POI HSSF/XSSF project on Android, so I did a port
> to Android.  I did a very basic spreadsheet, which can be seen here:
>
> https://github.com/dennis-sheil/android-spreadsheet
>
> The main reason the spreadsheet is so basic is that the first thing I
> did was implement a very basic spreadsheet frame.  Then I added HSSF
> functionality.  Then I added some more basic spreadsheet
> functionality.  So to be clear, I at this point had (and still have) a
> working Android project (a spreadsheet) that implements Apache POI
> HSSF functionality successfully.
>
> This is where the tl;dr part for some reading this might start.  If
> you're not interested in Apache POI XSSF being ported to Android, you
> can stop reading now.
>
> So after implementing HSSF successfully, I then tried to implement
> XSSF - and got stuck on that.  The problem is not per se with Apache
> POI XSSF.  The problem is with an Android concept called the "Dalvik
> executable".  You can Google that if you want.  The Android
> development process entails Java class files being converted into
> these Dalvik executable files.  Remember Android does not run a Java
> VM but a Dalvik VM.  The problem with these Dalvik executable files is
> that, according to Google they have a 65536 (
> http://code.google.com/p/android/issues/detail?id=7147 ) method limit
> for Dalvik executable files.  With all those jar files I had as
> reference libraries for XSSF going into the Dalvik (xmlbeans,
> poi-ooxml, log4j etc., including a schemas file even more stripped
> down than the stripped down schemas file that Apache put up), the
> 65536 method limit kept being hit.
>
> So there are two solutions I see for getting XSSF onto Android:
>
> 1) Keep whittling down at that schemas file and so forth to get under
> 65536 methods, and put out a project with one Dalvik executable.  This
> is the method that you people who are more familiar with POI than
> Android would be best at, and the one to think about first if you
> don't know Android pretty well.
>
> 2) Android has methods of loading multiple Dalvik Executable files
> into one Android project (
> http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html
> ).  So it can be worked at from that angle as well.
>
> Anyhow, as POI HSSF and XSSF are released under the Apache License,
> version 2, I thought it would be a good idea to release my port of POI
> HSSF to Android under the same license, so that is what I did.  Any
> XSSF work would be under the same license as well.  I'm open to
> suggestions on this front, we can all work together.  My main concern
> is getting not just HSSF, but XSSF onto Android as well.  If anyone is
> interested in helping me take a crack at bringing XSSF to Android,
> this is my e-mail address, and the code up on Github is at
> https://github.com/dennis-sheil/android-spreadsheet .  The license is
> Apache Version 2 for everything, so whether it's patched to my tree on
> Github, or brought back into POI, or whatever, anything is fine by me.
>  I'd just like to see XSSF on Android, alongside HSSF, which is
> working fine.  So anyone interested can contact me, or reply to the
> mailing list.  I posted this here since I saw some people talking
> about this in the past, and figured people would be interested (and
> have some POI expertise as well).
>
> Thanks,
> Dennis Sheil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to