Salv0
Salv0

Reputation: 1077

Best way to deal with many image resources?

I have a doubt regarding the best way to deal with many image resources. These images are the flags of all the Countries in the world so they are circa 200. Usually I store all the images in the res/drawable folder but in this case, they are too many. What would you suggest??

( I have to use them in an ImageView in a ListView )

Upvotes: 2

Views: 248

Answers (3)

Huang
Huang

Reputation: 4842

what 's your problem exactly ?as far as I know,android limits the apk file up to 50M.When you have a lot of resources, your app may exceed this limit.Is this your problem?

Upvotes: 1

Graeme
Graeme

Reputation: 25864

If you believe that the size of your images will push the size of your APK too high then perhaps create a thumbnail of each flag for most of your display purposes and use a WebView with a link to a larger version. This however will eat battery life & data & would only be available when the user is connected to the network.

Not recommended but if there is no other choice...

You could also download all of these flags on app initial start if it's the initial download of the apk you're worried about.

Otherwise keep your image sizes small and/or low quality to reduce the impact.

Upvotes: 1

David Olsson
David Olsson

Reputation: 8225

What's wrong in putting them in your drawable folder?

What you could do is two different versions, one for phones that have A2SD were you put them in your drawable folder and the other one downloads the flags to the users sd-card. At least let the user choose where to save them.

That way if the user wants the can be stored on the sdcard.

Upvotes: 1

Related Questions