user3567004
user3567004

Reputation: 117

Why do we have to provide images for all device screen sizes (mobile development)?

Why do we have to provide images for all screen sizes when developing mobile applications? Wouldn't it be more efficient to just have 1 very large image for each unique image and then scale the image down whenever the app is being run on a smaller device? It would definitely make the game's file size much smaller.

Upvotes: 1

Views: 59

Answers (2)

chiastic-security
chiastic-security

Reputation: 20520

In lots of cases, it wouldn't look as good.

If you find a set of well designed icons, you'll see that they've been independently designed for each resolution: the smaller ones will deliberately have less detail in, because downscaling just doesn't produce as good results.

Here are two GNOME icons, for the same thing, but one at 256x256 and one at 48x48. You can see that the 48x48 one has less detail in the writing on the letter, but the writing is also designed rather differently: on the 256x256 one it looks like the middle page of a document, and on the 48x48 one it looks like the opening of a letter, with an address at the top.

256px

48px

Upvotes: 4

Denley Bihari
Denley Bihari

Reputation: 601

It would make the size of the .apk file significantly smaller, but it would have more undesirable tradeoffs for runtime efficiency.

Having to load large bitmap objects and scale them down is an un-necessary load for the device's processor. But more importantly, having to load large bitmap objects into memory makes the VM's memory fill up more quickly. This means that the VM has to do garbage collection more often, which can cause noticeable delays at runtime (this can cause animations to lose frames and look rougher).

Upvotes: 1

Related Questions