Q: How do you suggest we open PDF files from a USB key or removable device?
When Qoppa’s PDF Android toolkit opens a PDF file, by default it uses a RandomAccessFile object and reads parts of the PDF file on-demand. The reason to do this is to preserve memory which is limited on Android.
You have control over this and you may use a different constructor on PDFDocument or a different loadDocument() method in the QPDFNotesView object.
If instead of using a file name, you use the methods that takes an InputStream, then the toolkit will load the PDF into memory and then will not need to read any more of the PDF file. In your code, you can create an InputStream to the PDF file, pass it into the qPDF Toolkit and then close the InputStream.
Of course, this means that the app will use more memory as it will have to hold the PDF in memory.
If this is a problem, another alternative for removable devices would be to copy the file to a temporary file in permanent storage and then work from that file.