I'm about to launch my first android application, and our graphic designer asked me for the resolution of the icons. From what I know in iOS there are constrains for the icon resolution, so what I'm asking is if there constrains here although I didn't read such in here. Also Should I get different resolutions for different screens or if I have high resolution icons will suffice? thank you in advance
Here i added the drawable image size.Hope it should helpful for you. Thanks.
Don't Create 9-patch images for launcher icons . You have to make separate image for each one.
drawable-ldpi (120 dpi, Low density screen) - 36px x 36px
drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px
drawable-hdpi (240 dpi, High density screen) - 72px x 72px
drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px
drawable-xxhdpi (480 dpi, Extra-high density screen) - 144px x 144px
drawable-xxxhdpi (640 dpi, Extra-high density screen) - 192px x 192px
web (320 dpi, Extra-high density screen) - 512px x 512px
Info : WEB(512 x 512) image is used when you upload your android application on Market.
Please refer the link for More details.
Android Iconography
DesigningResources
Related
I have a background for my app in resolutions 720x1280 pixels, 1080x1920 pixels and 1440x2560 pixels.
In which folders (mdpi, hdpi, xhdpi and xxhdpi) should I put each background?
Please read the Android Documentation regarding screen sizes.
From a base image size, there is a 3:4:6:8:12:16 scaling ratio in drawable size by DPI.
LDPI - 0.75x
MDPI - Original size // means 1.0x here
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3x
XXXHDPI - 4.0x
For example, 100x100px image on a MDPI will be the same size of a 200x200px on a XHDPI screen.
Require Screen sizes for splash :
LDPI: Portrait: 200 X 320px
MDPI: Portrait: 320 X 480px
HDPI: Portrait: 480 X 800px
XHDPI: Portrait: 720 X 1280px
XXHDPI: Portrait: 960 X 1600px
XXXHDPI: Portrait: 1440 x 2560px
Require icon Sizes for App :
http://iconhandbook.co.uk/reference/chart/android/
DP size of any device is (actual resolution / density conversion factor).
Density conversion factor for density buckets are as follows:
ldpi: 0.75
mdpi: 1.0 (base density)
hdpi: 1.5
xhdpi: 2.0
xxhdpi: 3.0
xxxhdpi: 4.0
Examples of resolution/density conversion to DP:
ldpi device of 240 X 320 px will be of 320 X 426.66 DP. 240 / 0.75 = 320 dp 320 / 0.75 = 426.66 dp
xxhdpi device of 1080 x 1920 pixels (Samsung S4, S5) will be of 360 X 640 dp. 1080 / 3 = 360 dp 1920 / 3 = 640 dp
This image show more:
For more details about DIP read here.
Check the image above I hope it will help someone.
Link to the whole article itself
Your inputs lack one important information of device dimension.
Suppose now popular phone is 6 inch(the diagonal of the display), you will have following results
DPI: Dots per inch - number of dots(pixels) per segment(line) of 1 inch.
DPI=Diagonal/Device size
Scaling Ratio= Real DPI/160.
160 is basic density (MHDPI)
DP: (Density-independent Pixel)=1/160 inch, think of it as a measurement unit
in order to know the phone resolution simply create a image with label mdpi, hdpi, xhdpi and xxhdpi. put these images in respective folder like mdpi, hdpi, xhdpi and xxhdpi. create a image view in layout and load this image.
the phone will load the respective image from a specific folder. by this you will get the phone resolution or *dpi it is using.
I would like to create a background image for different resolutions in Android. So I need the values (in pixel) for ldpi, mdpi, hdpi,xhdpi and xxhdpi. It is important that the image will not be blurred.
I have already read the Documentation about multiple screen support but there are sizes in dp instead of pixel.
Try follow below android icon graphy size reference for various device screen resolutin.
ldpi mdpi hdpi xhdpi xxhdpi xxxhdpi
Launcher And Home 36*36 48*48 72*72 96*96 144*144 192*192
Action Bar And Tab 24*24 32*32 48*48 64*64 96*96 128*128
Notification 18*18 24*24 36*36 48*48 72*72 96*96
Background 320*426 320*470 480*640 720*1280 1080*1920 1440*2560
there is no full list of screen resolutions, there are no fixed values in pixels for ldpi, mdpi, hdpi,xhdpi and xxhdpi. Every android device may have different resolution. If you want to fill all resolutions you will have to create too many images. If you put them in your app, it will make the app size huge. Maybe a better approach is to use composite image for background.
According to android documentation
mdpi is baseLine size
we can use it to measure all other scales , that mean if mdpi (scale 1) equal 1 xhdpi (scale 2) should equal 2 , multiplay mdpi sizes in scale value
all sizes width x height in pixel
xxxhdpi: 1280x1920 px // 4x
xxhdpi : 960x1440 px // 3x
xhdpi : 640x960 px // 2x
hdpi : 480x800 px // 1.5 x at least 480x720
mdpi : 320x480 px // baseline = 1x
ldpi : 240x360 px // .75 x
** notice I add xxhdpi with 3.0x scale to image*
xhdpi: 640x960 px
hdpi: 480x800 px
mdpi: 320x480 px
ldpi: 240x320 px
i think it is rather easy to convert the DP into pixels in andorid java i am achieving this with this function that i created
int getPixels(Context context, float dp) {
return (int) (context.getResources().getDisplayMetrics().density * dp + .5f);
}
hopefully this is helpful for people,
and kindly do share your views on it, as i would like to get this conversion as accurate as possible, thankyou
I am working on Android application that should support 2.1 till latest Android OS (4.2) version. Currently I have few images to display in my image-gallery module.
I need to support my app on all devices (smartphone and tablet) which support OS ranging from 2.1 to 4.2 (latest).
Each image is roughly of size 368X387, 50 KB each, PNG type
My workspace res contains following drawable folders:
drawable-hdpi
drawable-ldpi
drawable-mdpi
drawable-xdpi
I have some confusion around
In which folder should I store the images, and how will that matter?
Do I need to have different resolution based images for different type of devices?
Thanks.
You can store images only in 1 folder BUT,
for example you have device that is mdpi.. it will look good on him, but if you run your app on ldpi android will automatically scale your image and it will look ugly (low quality). So yea you need different resolution based images for different types of devices..
so mdpi resolution images go to drawable-mdpi
so hdpi resolution images go to drawable-hdpi etcc..
this is some list i found on internet about screen sizes, maybe you will find it helpful:
Low density Small screens QVGA 240x320 (120dpi):
layout-small-ldpi (240x320)
layout-small-land-ldpi (320x240)
Low density Normal screens WVGA400 240x400 (x432) (120dpi):
layout-ldpi (240 x 400 )
layout-land-ldpi (400 x 240 )
Medium density Normal screens HVGA 320x480 (160dpi):
layout-mdpi (320 x 480 )
layout-land-mdpi (480 x 320 )
Medium density Large screens HVGA 320x480 (160dpi):
layout-large-mdpi (320 x 480 )
layout-large-land-mdpi (480 x 320)
Galaxy Tab ( 240 dpi ):
layout-large (600 x 1024)
layout-large-land (1024 x 600)
High density Normal screens WVGA800 480x800 (x854) (240 dpi):
layout-hdpi (480 x 800)
layout-land-hdpi (800 x 480)
Xoom (medium density large but 1280x800 res) (160 dpi):
layout-xlarge (800 x 1280)
layout-xlarge-land (1280 x 800)
Also it would be good to read official documents site about supporting different types of screen.
There are four folder in resource folder 1- drawable-hdpi 2-drawable-ldpi 3-drawable-mdpi
4-drawable-xdpi
To declare different layouts and bitmaps you'd like to use for different screens, you must place these alternative resources in separate directories/folders. This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for mdpi, and 75x75 for ldpi devices.
Then, place the files in the appropriate drawable resource directory: as per your need
if you want to use same images for all types of screen then you can make an other folder named "drawable" and put all images in that folder. it would work as default drawable.
but if you want to improve image quality on all resolutions. then you need all 4 types images and put then on their respective folder with same image name. you can also make differ XMLs for each resolution.
See this http://developer.android.com/training/multiscreen/screendensities.html
You can put a particular image in all folders.
drawable-hdpi
---->img.png
drawable-ldpi
---->img.png
drawable-mdpi
---->img.png
drawable-xdpi
---->img.png
It all depends on your os .it ll take by default according to device resolution .
In android we have "Res" folder is nothing but resources folder.Inside this res folder we have other sub folders but for storing images we have four types of folders names are called:
drawable-hdpi
for High density screens and its resolutions is 480*800
drawable-ldpi
for Low density screens and its resolutions is 240*320
drawable-mdpi
for Medium density screens and its resolutions is 320*480
drawable-xdpi
for Xtra density density screens and its resolutions is 640*960
If you want to match image for multiple screens my suggestion is to use
Nine patch image rather than .png and .bmp
for creating nine patch image
http://developer.android.com/tools/help/draw9patch.html
I have published an app which have an mdpi, hdpi, xhdpi and xxhdpi image for the app icon.
I have received some feedback that on ldpi devices my icon wasn't used and the default one from android is used.
Why is that ? My app has a drawable-ldpi folder but it is empty. Should I delete it ? Is this specific to the launcher icon ?
EDIT : I don't have any image in the drawable folder, only xml shape or selector. I have see this issue with a ldpi screen of 240 x 320 pixels (Samsung Galaxy Y running Android 2.3.6).
I'm talking about this application : http://code.google.com/p/morpion-1vs1/ (the code is public because otherwise I should pay for the repository, I know the activities are a bit messy)
Here is the icon used :
Put a 36x36 pixel size version of your application launcher icon "j5oDi.png" into "drawable-ldpi".
The Launcher icon sizes are described here: Launcher Icons -> Size and Format
You should have icon files in each of those resource folders at various sizes:
res/drawable-ldpi (120 dpi - Low density screen): 36x36 px
res/drawable-mdpi (160 dpi - Medium density screen): 48x48 px
res/drawable-hdpi (240 dpi - High density screen): 72x72 px
res/drawable-xhdpi (320 dpi - Extra-high density screen): 96x96 px.
As we know, the correct sized icon:
* drawable-ldpi (120 dpi, Low density screen) - 36px x 36px
* drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px
* drawable-hdpi (240 dpi, High density screen) - 72px x 72px
* drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px
On Jelly Bean, drawable-xxhdpi can be supported. So what's the correct size icon?
MDPI: 48x48
HDPI: 72x72
XHDPI: 96x96
XXHDPI: 144x144
XXXHDPI: 192x192
to create an icon for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and xxx-high respectively)
- developer.android.com
This is a quote from a post on Google Plus https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW by Nick Butcher
The gorgeous screen on the Nexus 10 falls into the XHDPI density
bucket. On tablets, Launcher uses icons from one density bucket up
[0] to render them slightly larger. To ensure that your launcher icon
(arguably your apps most important asset) is crisp you need to add a
144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
So, for the xxhdpi qualifier, you will need to create an icon of the size 144*144px for your launcher icon. You can either place it in the drawable-xxhdpi or the drawable-480dpi
EDIT: To add to the original answer to address cone of the comments by the OP.
As per this link: http://developer.android.com/guide/practices/screens_support.html#DesigningResources, alternative resources should be created using this ratio: 3:4:6:8 scaling ratio. However, if you are concerned about loosing quality with regards to your in-app drawable resource, consider using 9-patch images wherever possible. That will reduce or eliminate any loss of quality. The Android OS all by itself, does a remarkable job handling various screen sizes most of the time anyway.
As for the icon size 144*144px, create either of these two folder drawable-xxhdpi or the drawable-480dpi and place just your launcher icon of the said size in it. That should do it.
You need to add a 144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
For more information:-
Official G+ shows that xxhdpi is 480dpi:
https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW
Standart icon size in dip is 48 dip.
You might use this service for creation all size icons. (Set size - 48 dip, and other settings)