Tuesday 2 September 2014

Reading XLSX on android 4 (Post 2)

!!!UPDATE:
All this hacking is getting redundant with Android Build Tools 21+ and Android 5, please see this post for details: http://blog.kondratev.pro/2015/08/reading-xlsx-on-android-4-and-hopefully.html
-----------------

Further to my post from Saturday on reading XLSX on Android:

I shrunk dom4j, poi, poi-ooxml and xmlbeans into one jar with proguard. All classes not necessary for reading Excel files are seems to be removed. Proguard config follows:

-injars      {my IN jars mentioned above}
-outjars     poi-min.jar

-libraryjars {my dir with schemas}
-libraryjars {path to /jre/lib}
-libraryjars {path to /jdk/lib}

-dontoptimize
-dontobfuscate
-ignorewarnings

-keep class org.apache.poi.xssf.** { *; }
-keep class org.apache.poi.ss.** { *; }
-keep class org.apache.poi.hssf.** { *; }
-keep class org.apache.xmlbeans.** { *; }

It works fine for reading and writing both XLS and XLSX files.

Next post on XLSX:
http://blog.kondratev.pro/2014/09/reading-xlsx-on-android-3.html

Previous post on XLSX:
http://blog.kondratev.pro/2014/08/reading-xlsx-on-android.html

No comments:

Post a Comment