19

I need to know the screen sizes of android devices to support multiple screen sizes application.

inazaruk
  • 74,247
  • 24
  • 188
  • 156
FAFI
  • 379
  • 2
  • 6
  • 21

8 Answers8

18

Look at this table: http://developer.android.com/guide/practices/screens_support.html#testing

You can use the pie chart here to have an idea of relative screen size usage: http://developer.android.com/resources/dashboard/screens.html

For a list of screen sizes, resolutions and dpi values, take a look at: http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density

To calculate the real dpi value, check here: http://en.wikipedia.org/wiki/Pixel_density#Calculation_of_monitor_PPI

Aleadam
  • 40,203
  • 9
  • 86
  • 108
17

I don't think there's a comprehensive list of all existing screen sizes, since new devices are coming out all the time. Have you seen the page on Screen Sizes and Densities and the documentation on Supporting Multiple Screens?

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • I did read that and I did as explained but when I tested my application on android3 emulator my application appeared in a small part of the screen.But I won't it to fill the whole screen can I control that? – FAFI Jun 04 '11 at 07:48
  • You need to use the `` tag in the manifest to indicate what screen sizes your app supports. There's also an interaction with the [targetSdkVersion](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target) attribute of the `uses-sdk` tag in the manifest. If you target too low an sdk level, devices (and emulators) running later levels might switch to compatibility mode for the application, which may restrict your application to a simulation of an HVGA screen. – Ted Hopp Jun 05 '11 at 03:00
16

Different screen sizes are as follows.

xlarge screens are at least 720dp 960dp
large screens are at least 480dp x 640dp
normal screens are at least 320dp x 470dp
small screens are at least 320dp x 426dp

If you are plan to make an application which support for multiple devices, also you have to crate different layout directories for put different layouts.

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

If you are plan to add different sizes of images, put them in following folders accordingly. Android OS will automatically take the most suitable image out of them.

res/drawable-ldpi/my_icon.png        // bitmap for low density
res/drawable-mdpi/my_icon.png        // bitmap for medium density
res/drawable-hdpi/my_icon.png        // bitmap for high density
res/drawable-xhdpi/my_icon.png       // bitmap for extra high density

enter image description here

enadun
  • 3,107
  • 3
  • 31
  • 34
  • How to add images for , ldpi(240*320) and hdpi(480*640) in small screen folder ! – Tushar Pandey Feb 10 '14 at 05:10
  • You just have to put correct re-sized images in corresponding drawable folders. Android OS will automatically get the images from corresponding drawable folder, according to the screen sizes of the device. – enadun Feb 10 '14 at 17:20
  • 1
    thanks enadun , i think you want to say these types of folder . http://pages.citebite.com/p2t7t5p0b9qki – Tushar Pandey Feb 11 '14 at 06:01
7

Android supports multitude of screen sizes. There is no list of specific screen sizes. Only approximate ranges. Read more at "Supporting Multiple Screens".

inazaruk
  • 74,247
  • 24
  • 188
  • 156
  • I've read that already but the whole point is that I want to have only one xml and I'll control the widgets' positions through my code – FAFI Jun 03 '11 at 20:20
  • You can't predict all possible variants of screen sizes. So you need to work in screen-size-agnostic ways. If you read reference article you'll see what approaches you can take to make your code working on all (or most) screens. – inazaruk Jun 03 '11 at 20:27
  • what I get from that article that i'll have to make different xmls for different screen sizes and to – FAFI Jun 03 '11 at 20:47
  • @inazaruk is correct, you can have a single xml layout that works for all screen sizes if you want, or you can provide a dpi-based layout for each of low, medium, or high dpi values. The key is to allow the views to resize themselves as needed and depending on dpi, as opposed to absolutely positioning and sizing them yourself. – bensnider Jun 03 '11 at 20:58
  • Ok but when i did as you've just said my application looked very bad on android 3 emulator that's why I'm trying to do what I'm doing – FAFI Jun 03 '11 at 21:06
  • Actually It looks like the size specified for the application on and3 emulator is small that's why it looks small can I control that? – FAFI Jun 03 '11 at 21:55
2

In terms of supporting different screen sizes I would start by taking a look at the Screen Support Reference, might be able to solve your problem better. To see a list of specific sizes take a look at Table 2

Loktar
  • 34,764
  • 7
  • 90
  • 104
1

Here it comes!

  • (240, 320)
  • (240, 400)
  • (320, 480)
  • (360, 640)
  • (480, 640)
  • (480, 800)
  • (480, 854)
  • (540, 960)
  • (600, 800)
  • (600, 1024)
  • (640, 960)
  • (720, 1280)
  • (768, 1280)
  • (768, 1024)
  • (800, 1280)
  • (1080, 1920)
  • (1200, 1920)
  • (1600, 2560)

fresh from http://en.wikipedia.org/wiki/Comparison_of_Android_devices 's html sources parsed with:

import re

s = ""

with open("sizes.html", "r") as src:
    s = src.read()

res = re.findall('([0-9]+)\s*[×xX]\s*([0-9]+)', s)

sizes = set()

for match in res:
    size_int = [int(match[0]), int(match[1])]
    size = (min(size_int), max(size_int))
    if size not in sizes:
        sizes.add(size)

sorted_sizes = list(sizes)
sorted_sizes.sort(key=lambda sz: sz[0])

for sz in sorted_sizes:
    print(sz)

(forgive my python)

thumbmunkeys
  • 20,606
  • 8
  • 62
  • 110
mlvljr
  • 4,066
  • 8
  • 44
  • 61
0

Here's a little function to know the inch size of your device in case you need it to support multisize screen :

public double getInchSize()
{
    DisplayMetrics metrics = getResources().getDisplayMetrics();
    return Math.hypot(metrics.widthPixels/metrics.xdpi, metrics.heightPixels/metrics.ydpi)
}

Hope it can help

Arthur Rey
  • 2,990
  • 3
  • 19
  • 42