Search code examples
androidscreen-resolution

How does Android define a screen resolution as long?


With Android, you can define different resources for different phone attribute by naming res directories appropriately. I need to be able to support different layouts for 480x800 and 480x854. I figured I could have one set of resources stored in the layout-hdpi-v4 directory and another in layout-long-hdpi-v4. However, both resolution seem to think that they are long (at least based on the emulator, which I understand may not reflect devices accurately).

Is there another way in which I can distinguish between the two resolutions/aspect ratios?


Solution

  • There is a screen size qualifier, though its use is deprecated and recommended to not be used:

    layout-800x480,layout-854x480

    Otherwise, it doesn't look like there is a supported way in resource naming that can differentiate the two resolutions, besides using flexible layouts to expand into the extra screen space.