Reputation: 1
i'm an italian guy and i'm developing an android app for a course that i'm attending at Information and Communication Technologies university. This is my question: following android philosophy, it is right to create 12 folders for different values of hight and width (in dpi) in android?
I mean:
values-ldpi
values-mdpi
values-hdpi
values-xhdpi
values-small-ldpi
...
...
...
values-xlarge-hdpi
values-xlarge-xhdpi
I can't use "match_parent"
or "wrap_content"
everywhere, so for some components i have to specify the size in dpi.
Upvotes: 0
Views: 241
Reputation: 363737
There is not a generic rule that can work always.
In some cases you could have to use values-land
, values-v14
, values-large-land-v14
, values-sw720dp
....depends on the app you want to achieve.
Don't forget values-xxhdpi
Upvotes: 0
Reputation: 5266
Your solution is certainly the most exhaustive and thorough. It isn't necessarily "right" as you say though.
Ideally you would be able to create values/layouts/drawables for every possible combination of screen size/density. In the real world, it is more common to focus on a particular subset.
For example, you can have a look at the most commonly used screen densities here (updated periodically).
There are particular drawbacks to being exhaustive, including large .apk sizes if you are dealing with drawables, and as such you can scale back your approach and focus elsewhere, or release multiple .apk's for your application.
There is an in-depth article on Supporting Multiple Screens on Android here which is well worth a read.
Upvotes: 0
Reputation: 6319
That is correct, but you can get a whole way by simply putting up your XML layouts smartly, using Fragments and thinking of a design that allows the use of some relative position descriptions.
Upvotes: 1