Reputation: 7539
I am just using simple default layout and not adding any of these layout versions; l-dpi-Layout
,m-dpi-layout
etc.. then what exactly the resolution of my default layout is?
Let say i add an image and define its width-height
as 20dp X 20dp
. This image is looking perfect in layout Preview
screen, but would it look same in 1440X2560
screen or 1920X1080
screen.
My concerns are:
20 dpi
i am defining fits best for 1080X1920
resolution and 27dpi
fits best 1440X2560 screen
, when i am writing 20dpi
in my default layout which perfectly fits in layout preview
screen Upvotes: 1
Views: 3140
Reputation: 742
Upvotes: 1
Reputation: 1886
The system assumes a target device with a density of 160dpi. When you define the size of yout image with dp unit, Android adapts the size according with the resolution of the device. For example, if you put an image of 100dp x 100dp in a 160dpi device it will take 100 x100 pixels, but in a device with a 640dpi screen it will take 400 x 400 pixel
Upvotes: 3