Anyone knows how to load big pdf file in Android? I use "android-pdf-viewer" to load that kind of file. It works when the file is small. But once the file is too big(150M eg.),it throws OOM exception.
11-28 21:07:43.596 7844-8419/com.example.caoweizhao.readerapp E/art: Out
of memory: Heap Size=192MB, Allocated=83MB, Capacity=192MB
11-28 21:07:43.596 7844-8419/com.example.caoweizhao.readerapp W/art:
Throwing OutOfMemoryError "Failed to allocate a 134209548 byte
allocation with 16777216 free bytes and 108MB until OOM"
11-28 21:07:43.607 7844-7844/com.example.caoweizhao.readerapp E/PDFView: load pdf error
java.lang.OutOfMemoryError: Failed to allocate a 134209548 byte allocation with 16777216 free bytes and 108MB until OOM
at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201)
at com.github.barteksc.pdfviewer.util.Util.toByteArray(Util.java:37)
at com.github.barteksc.pdfviewer.source.InputStreamSource.createDocument(InputStreamSource.java:37)
at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:53)
at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:25)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
11