topher
topher

Reputation: 1397

why must provide different images for different screen densities?

Why developers must provide different images for different screen densities (ldpi, mdpi, hdpi, xhdpi) ?

Why don't we just provide one big image for big density (e.g. hdpi or xhdpi) ?

Upvotes: 1

Views: 73

Answers (2)

Eugene Loy
Eugene Loy

Reputation: 12416

There are couple of reasons why you might want to do this:

  • Resizing on the fly takes resources (CPU/memory) and thus slows your app
  • You might not be satisfied with resizing algorithm or know how to resize your image to get better end result (think of the case when you have vectors for your image)
  • you might want to use different image for different densisies at all (think of the case when your image contain text. You might want to ommit text on low density image if there is not enough space to show it)

Upvotes: 3

Hannoun Yassir
Hannoun Yassir

Reputation: 21182

If you do provide big images android will have to scale them wish isn't really optimal because it will waste energy and slow your app.

Upvotes: 1

Related Questions