tags:

views:

608

answers:

1

I have an image that I want to place on the background on my activity. For the G1 I would use a background of 320x480 but with the nexus 1 the resolution is almost double that. Should I just place the large image and make the smaller phones size down? I am trying to keep the size of my package down as much as possible.

A: 

If it's a simple colour or a gradient, you can share the same drawable for all screen resolutions.

If it's a more complex graphic, then you should create separate images for different screen resolutions (or densities) by placing them in the appropriate directories (e.g. "drawable-nodpi", "drawable-hdpi" etc.).

Christopher
OK, thanks...however, wouldn't having 2 images instead of 1 bulk up my file size? Why not just use the the large one and let android resize? CPU is not an issue at the moment.
jax
Well you can try it for yourself on the emulator; the graphic may well look nasty when scaled up or down. But surely your background graphic isn't that large anyway -- I wouldn't say there's any reason to worry about APK size unless it's heading towards multiple megabytes...
Christopher