Search code examples
androidandroid-gallery

Android - where it is the best place to store a list of images locally?


I am working at an application that currently will have data only locally (server part is not ready) - the apk must contain the displayed data too. So I will have a list of items, each item having an image. Where it is the best place to store those images, such that the apk size is kept as small as possible?

Searching I found that /raw or /assets can be such places. Or is it better to store images as base64 encoded dirrectly in the loaded JSONs? Which is best?


Solution

  • Searching I found that /raw or /assets can be such places. Or is it better to store images as base64 encoded dirrectly in the loaded JSONs? Which is best?

    if you have a different image for each density you should go for ths drawable-* folders, otherwise it does not make that much difference from the apk's size perspective. I would avoid the base64 solution