0

I would like to convert word and excel documents to html to show them in the browser in my android app.

I found apache poi library, but it converts practically only text without object like forms, diagrams, wordart etc. Or is it possible and I forgot something?

I found also apache tika, but when I added that library to my project I could'nt compile it because of java heap space error (I have in my eclipse.ini file set Xms768m and Xmx2048m). I tried also to load that library at runtime and tried to use dx tool, but I got outofmemory exception.

What could I do with that or is there any possibility to show office documents in the android app?

Bartosz Bialecki
  • 4,391
  • 10
  • 42
  • 64

1 Answers1

0

To handle the OOM error while using the dexer:

there is a dx script used during the builds and it sets a default heapsize for the dexer. The script lives here:

$ANDROID_SDK/build-tools/dx (or dx.bat depending on OS).

There is a section in there that looks like this:

# By default, give dx a max heap size of 1 gig. This can be overridden
# by using a "-J" option (see below).
defaultMx="-Xmx1024M"

# The following will extract any initial parameters of the form
# "-J<stuff>" from the command line and pass them to the Java
# invocation (instead of to dx). This makes it possible for you to add
# a command-line parameter such as "-JXmx256M" in your scripts, for
# example. "java" (with no args) and "java -X" give a summary of
# available options.

javaOpts=""

Maybe try changing javaOpts to -Xmx2048M or something like that.

K.R.
  • 477
  • 1
  • 4
  • 13