0

I have an APK Expansion Zip file with ~100 MB of images along with some other pertinent files.

  1. Is it feasible to load the images directly out of the zip file without extracting, or will it slow performance?

  2. If so, how can I use the resulting InputStream to load an image using Picasso?

To clarify, I fully understand how to extract files, how to retrieve InputStreams, and how to turn these InputStreams into Bitmaps; my issue is using this in tandem with Picasso... Picasso only accepts paths, Uris, files, and resourceIds. I have large lists of images which are reliant on the caching mechanisms of Picasso, and if possible I would like to avoid duplicating the contents of the zip file by extracting, as this would needlessly bloat the app storage size.

I have scoured the web for answers without success, here are two of the better results:

https://medium.com/@jpardogo/custom-picasso-downloader-d34d97cc28fc#.7gmj4i746 - Method signatures are outdated, or I'm otherwise not understanding how to use the Downloader class.

How we can use images from APK main expansion file? - This only addresses how to create a Bitmap; I don't want to re-invent the wheel with respect to caching, recycling, etc.

Community
  • 1
  • 1
Demonsoul
  • 791
  • 4
  • 11
  • Use your own `RequestHandler` and create the `Picasso` singleton with it. https://square.github.io/picasso/2.x/picasso/com/squareup/picasso/RequestHandler.html – Jared Rummler Nov 24 '16 at 22:07
  • Thank you for the nudge in the right direction, I'm making progress so far. – Demonsoul Nov 25 '16 at 14:50

0 Answers0