Android categorizes device screens using two general properties: size
and density.
+ There are four
generalized sizes: small, normal, large, xlarge
+ There are four generalized densities: low (ldpi), medium
(mdpi), high (hdpi), extra high (xhdpi)
+ and
five different screen size layout : layout, layout-large, layout-land,
layout-large-land.
Note : To support different screen, Use different image size in different directory.
Create Different Layouts
Create Different Layouts
System loads the layout file from
the appropriate layout directory based on screen.
project --- > Resource --- >
project --- > Resource --- >
1. layout : for normal screen
[default (portrait)]
2. layout-large
: for large
screen like tablet
3. layout-land
: for
landscape ( Horizontal orientation ) device.
4. layout-large-land/ : large landscape
Create Different Bitmaps
low, medium, high and extra-high density. This helps you achieve good graphical
quality and performance on all screen densities.
To generate these images, you should
start with your raw resource in vector format and generate the images for each
density using the following size scale:
·
xhdpi (Xtra High Definition Pixel ) : 2.0 200*200
pixel
·
hdpi
( High Definition Pixel ) :
1.5 150*150 pixel
·
mdpi
( Medium Definition Pixel ) : 1.0 (baseline) 100*100 pixel
·
ldpi ( Low Definition Pixel ) : 0.75 75*75 pixel
Placing images to different directory like -
my project --- > resource
No comments:
Post a Comment