Hacker News new | ask | show | jobs
by GBKS 4357 days ago
I think Android is shooting itself in the foot here by making things look more complicated than they might be. Take a look at the documentation for screen support (http://developer.android.com/guide/practices/screens_support...).

They split phone sizes (2-10") into four generalized sizes (small, normal, large, xlarge). Then they split screen density into generalized densities (ldpi, mdpi, hdpi, xhdpi) based on 3:4:6:8 ratios. The example on the page lists 5 different layout XML files (the 4 previously mentioned + extra large landscape orientation) for different sizes, and three folders for image assets in different densities.

But, there are tablet layouts for Android 3.2+, which use a completely different system based on size qualifiers where you can provide minimum/maximum pixel sizes for layouts.

The logic for iOS seems super simple in comparison.

With a few Android projects under your belt, you have probably internalized how everything works, and which parts are fringe cases you can ignore. But if you're new to this (or a journalist/analyst with limited technical depth), it seems like an absolute mess. Simply rewriting this documentation and providing better tutorials and resources could go very far to clarify the situation.

1 comments

Generalised sizes are a deprecated way of handling screen sizes on Android, from version 3.2 onward we use far more traditional dividers such as minimum width. For many developers it's viable to support only 4+, which lets you avoid a lot of the trickiness.

Also, even if you are supporting 2.x, you don't HAVE to have a separate layout file for each generalized size. If you make a flexible layout that works on all sizes, you can just declare it once (and doing so is not difficult in most cases).

I totally agree the documentation needs work. Some areas have not been updated in a very long time.