MichK
MichK

Reputation: 3252

Download many application resources upon application startup

I have a task to prepare application running on iOs and Android. Application will display data composed of text and images. All this data has to be downloaded durring firs application start. One of my first thought was to put all images in XML file as CDATA and encode in base64, but this would probably consume a lot of space, so my question is:

Should I concatenate all my images into one file (if so then how), download this file and "extract"(how ?) those images in my app? Or maybe I should download many small images because it is not a problem and proper way of doing this?

Thanks!

Upvotes: 0

Views: 215

Answers (2)

MichK
MichK

Reputation: 3252

I made a hierarchy of dirs and put my images there, every image and xml is a separate file. My app downloads images and xml files at startup and this works.

Upvotes: 0

shkschneider
shkschneider

Reputation: 18243

Many options are available to you:

  1. Bundle images with your application

    Looks like you don't want that.

  2. Download all images

    Using a AsyncTask to avoid not responding main UI thread and to avoid using network over main thread.

  3. Download all images as a zip files

    Same as before, but with a single zip file (and you could show a progress bar).

    Then unzip it with the plateform's tools.

Upvotes: 1

Related Questions