How can I identify a device that does has a HD-Screen such the Asus HD?
I did some research and find some parameters on which i'm trying to calculate that.
Where the first info is from GSM arena (size and ppi) and the DisplayMetrics collected from the device trough getDisplay().getDisplayMetrics();
Asus HD - 1920 x 1200 pixels, 10.1 inches (~224 ppi pixel density) - DisplayMetrics{density=1.5, width=1920, height=1128, scaledDensity=1.5, xdpi=159.89508, ydpi=159.58115}
GTab - 800 x 1280 pixels, 10.1 inches (~149 ppi pixel density) - DisplayMetrics{density=1.0, width=800, height=1280, scaledDensity=1.0, xdpi=160.15764, ydpi=160.0}
Xoom - 800 x 1280 pixels, 10.1 inches (~149 ppi pixel density) - DisplayMetrics{density=1.0, width=1280, height=752, scaledDensity=1.15, xdpi=149.82489, ydpi=149.41176}
Xoom 2 ME - 800 x 1280 pixels, 8.2 inches (~184 ppi pixel density) - DisplayMetrics{density=1.0, width=1280, height=752, scaledDensity=1.0, xdpi=149.82489, ydpi=149.41176}
nexus 7 - 800 x 1280 pixels, 7.0 inches (~216 ppi pixel density)
nexus 7 2 - 1200 x 1920 pixels, 7.0 inches (~323 ppi pixel density)
Gnote II - 720 x 1280 pixels, 5.5 inches (~267 ppi pixel density)
Gnote - 800 x 1280 pixels, 5.3 inches (~285 ppi pixel density)
Gtab 7.7 - 800 x 1280 pixels, 7.7 inches (~196 ppi pixel density)
Gtab 7 - 600 x 1024 pixels, 7.0 inches (~170 ppi pixel density)
I tought using density as the parameter to identify it, but most devices return 1.0 (at least Asus HD does return 1.5) but I'm not sure that I can rely on those values.
There's any better aproach to identify then?
Regardless of the argument over "what is HD". If you want something based on Denisty;
Do it with resource qualifiers:
In the files:
/values-xxxhdpi/hd.xml
/values-xxhdpi/hd.xml
/values-xhdpi/hd.xml
hd.xml:
<resources>
<bool name="isWhatIClassifyAsHD">true</bool>
</resources>
(setting the below is optional as they would be false anyway).
/values/hd.xml
/values-mdpi/hd.xml
/values-hdpi/hd.xml
hd.xml:
<resources>
<bool name="isWhatIClassifyAsHD">false</bool>
</resources>
Then in your activity:
boolean isHD = getResources().getBoolean(R.bool.isWhatIClassifyAsHD);
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.
For instance, I have a Galaxy Tab 2 http://www.gsmarena.com/samsung_galaxy_tab_2_10_1_p5100-4567.php which has display size 800 x 1280 pixels
How can I calculate with and height in dp?
I want to use relevant values in resource folder names
values-sw600dp
Galaxy Tab 2 has 10.1" display and 800 x 1280.
For sw (smallest width):
800 / (141/160) = 800 / 0.88125 = 907.8 dp -> so it fits to for example into sw600dp.
141 - DPI of screen
160 - DPI of MDPI screen
800 - pixels in width
Basicaly sw-600dp fits to 7" tablets and sw-720dp fits to 10" tablets.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
This post was edited and submitted for review 9 months ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I understand that Android's developer site provides information on this topic. I have already read the following three pages:
Supporting Multiple Screens
Screen Sizes and Densites
Icon Design Guidelines
They do not give the information/statistics that I am looking for. Judging from the second link, the two most important screen categories to support are normal-hdpi and normal-mdpi.
The problem is that simply knowing that these two categories are the most popular is of no help to me. The website gives me a range of screen sizes and densities that go into these categories, but the ranges are quite large.
I want to know what the most popular phones are in these two categories. More specifically, I am looking for the most popular resolutions in these two categories.
DEVELOPER-DOCS
240*320-ldpi
240*400-ldpi
240*432-ldpi
320*480-mdpi
480*800-mdpi
480*854-mdpi
1024*600-mdpi
1280*800-mdpi
480*800-hdpi
480*854-hdpi
280*280-hdpi
320*320-hdpi
720*1280-xhdpi
1200*1290-xhdpi
2560*1600-xhdpi
768*1280-xhdpi
1080*1920-xxhdpi
800*1280-tvdpi
I use these reference to make my app
Quoting an answer from another stackOverflow post for more details
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
Device Inches ResolutionPX Density DPI ResolutionDP AspectRatios SysNavYorN ContentResolutionDP
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
Galaxy Y 320 x 240 ldpi 0.75 120 427 x 320 4:3 1.3333 427 x 320
? 400 x 240 ldpi 0.75 120 533 x 320 5:3 1.6667 533 x 320
? 432 x 240 ldpi 0.75 120 576 x 320 9:5 1.8000 576 x 320
Galaxy Ace 480 x 320 mdpi 1 160 480 x 320 3:2 1.5000 480 x 320
Nexus S 800 x 480 hdpi 1.5 240 533 x 320 5:3 1.6667 533 x 320
"Galaxy SIII Mini" 800 x 480 hdpi 1.5 240 533 x 320 5:3 1.6667 533 x 320
? 854 x 480 hdpi 1.5 240 569 x 320 427:240 1.7792 569 x 320
Galaxy SIII 1280 x 720 xhdpi 2 320 640 x 360 16:9 1.7778 640 x 360
Galaxy Nexus 1280 x 720 xhdpi 2 320 640 x 360 16:9 1.7778 640 x 360
HTC One X 4.7" 1280 x 720 xhdpi 2 320 640 x 360 16:9 1.7778 640 x 360
Nexus 5 5" 1920 x 1080 xxhdpi 3 480 640 x 360 16:9 1.7778 YES 592 x 360
Galaxy S4 5" 1920 x 1080 xxhdpi 3 480 640 x 360 16:9 1.7778 640 x 360
HTC One 5" 1920 x 1080 xxhdpi 3 480 640 x 360 16:9 1.7778 640 x 360
Galaxy Note III 5.7" 1920 x 1080 xxhdpi 3 480 640 x 360 16:9 1.7778 640 x 360
HTC One Max 5.9" 1920 x 1080 xxhdpi 3 480 640 x 360 16:9 1.7778 640 x 360
Galaxy Note II 5.6" 1280 x 720 xhdpi 2 320 640 x 360 16:9 1.7778 640 x 360
Nexus 4 4.4" 1200 x 768 xhdpi 2 320 600 x 384 25:16 1.5625 YES 552 x 384
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
Device Inches ResolutionPX Density DPI ResolutionDP AspectRatios SysNavYorN ContentResolutionDP
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
? 800 x 480 mdpi 1 160 800 x 480 5:3 1.6667 800 x 480
? 854 x 480 mdpi 1 160 854 x 480 427:240 1.7792 854 x 480
Galaxy Mega 6.3" 1280 x 720 hdpi 1.5 240 853 x 480 16:9 1.7778 853 x 480
Kindle Fire HD 7" 1280 x 800 hdpi 1.5 240 853 x 533 8:5 1.6000 853 x 533
Galaxy Mega 5.8" 960 x 540 tvdpi 1.33333 213.333 720 x 405 16:9 1.7778 720 x 405
Sony Xperia Z Ultra 6.4" 1920 x 1080 xhdpi 2 320 960 x 540 16:9 1.7778 960 x 540
Kindle Fire (1st & 2nd gen) 7" 1024 x 600 mdpi 1 160 1024 x 600 128:75 1.7067 1024 x 600
Tesco Hudl 7" 1400 x 900 hdpi 1.5 240 933 x 600 14:9 1.5556 933 x 600
Nexus 7 (1st gen/2012) 7" 1280 x 800 tvdpi 1.33333 213.333 960 x 600 8:5 1.6000 YES 912 x 600
Nexus 7 (2nd gen/2013) 7" 1824 x 1200 xhdpi 2 320 912 x 600 38:25 1.5200 YES 864 x 600
Kindle Fire HDX 7" 1920 x 1200 xhdpi 2 320 960 x 600 8:5 1.6000 960 x 600
? 800 x 480 ldpi 0.75 120 1067 x 640 5:3 1.6667 1067 x 640
? 854 x 480 ldpi 0.75 120 1139 x 640 427:240 1.7792 1139 x 640
Kindle Fire HD 8.9" 1920 x 1200 hdpi 1.5 240 1280 x 800 8:5 1.6000 1280 x 800
Kindle Fire HDX 8.9" 2560 x 1600 xhdpi 2 320 1280 x 800 8:5 1.6000 1280 x 800
Galaxy Tab 2 10" 1280 x 800 mdpi 1 160 1280 x 800 8:5 1.6000 1280 x 800
Galaxy Tab 3 10" 1280 x 800 mdpi 1 160 1280 x 800 8:5 1.6000 1280 x 800
ASUS Transformer 10" 1280 x 800 mdpi 1 160 1280 x 800 8:5 1.6000 1280 x 800
ASUS Transformer 2 10" 1920 x 1200 hdpi 1.5 240 1280 x 800 8:5 1.6000 1280 x 800
Nexus 10 10" 2560 x 1600 xhdpi 2 320 1280 x 800 8:5 1.6000 1280 x 800
Galaxy Note 10.1 10" 2560 x 1600 xhdpi 2 320 1280 x 800 8:5 1.6000 1280 x 800
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
Device Inches ResolutionPX Density DPI ResolutionDP AspectRatios SysNavYorN ContentResolutionDP
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ----------
You can see the resolutions for those categories in the Table 2, in this section: http://developer.android.com/guide/practices/screens_support.html#testing
Also, their "device dashboard" stats at:
http://developer.android.com/about/dashboards/index.html#Screens
can be pretty helpful. They are current and derived from Android Market visits.
Another alternative to see popular android resolutions or aspect ratios is Unity statistics:
LATEST UNITY STATISTICS (on 2019.06 return http503) web arhive
Top on 2017-01:
Display Resolutions:
1280 x 720: 28.9%
1920 x 1080: 21.4%
800 x 480: 10.3%
854 x 480: 9.7%
960 x 540: 8.9%
1024 x 600: 7.8%
1280 x 800: 5.0%
2560 x 1440: 2.4%
480 x 320: 1.2%
1920 x 1200: 0.8%
1024 x 768: 0.8%
Display Aspect Ratios:
16:9: 72.4%
5:3: 18.2%
16:10: 6.2%
4:3: 1.7%
3:2: 1.2%
5:4: 0.1%
Here is a list of almost all resolutions of tablets, with the most common ones in bold :
2560X1600
1366X768
1920X1200
1280X800
1280X768
1024X800
1024X768
1024X600
960X640
960X540
854X480
800X600
800X480
800X400
Happy designing .. ! :)
A blog article from Localytics, Android Not As Fragmented as Many Think, lists most popular Android sizes and resolutions:
Another concern for Android developers is screen size and resolution. Of all app usage analyzed for this study, 41% of all sessions came from Android devices with 4.3 inch screens, by far the most popular size. 4 inch screens accounted for 22% of sessions, 3.2 inch screens for 11%, and 3.7 inch screens contributed 9%.
Resolutions were even less fragmented, however, with the most widely-seen screen resolution – 800 x 480 pixels – contributing 62% of the study’s sessions. The next most popular screen resolutions were 480 x 320 (14%), 960 x 540 (6%), 480 x 854 (5%) and 320 x 240 (5%).
Please note these statistics are from February 2012, which might be outdated today. Also, please always keep in mind that your app might be used under the inch sizes and resolutions not listed in this article.
EDIT: You should also be aware that there are Android "tablets" with large resolutions. The following quote is from the same article I mentioned:
Screen resolution and size are actually even less fragmented than handsets – 74% of Android tablet usage takes place on 7 inch devices with 1024 x 600 resolution. 22% are 10.1 inch devices with 1280 x 800 resolutions, so by taking into account two screen size/resolution combinations, developers should be able to easily reach nearly all of the Android tablet market.
There is now official Device Metrics on the Material Design site, those metrics are a hand picked devices list, not an actual statistics, but it too can be really helpful: https://material.io/devices/
The vast majority of current android 2.1+ phone screens are 480x800 (or in the case of motodroid oddities, 480x854)
However, this doesn't mean this should be your only concern. You need to make it looking good on tablets, and smaller or 4:3 ratio smaller screens.
RelativeLayout is your friend!
i have display image in android tablet..
real size is 209x209 px, it's actualy big..
but when i display it in android tablet, it's become small..
how much standart width and height for image in android tablet?
The available width and height of Tab in market are following:
Product Display Size Display Resolution Aspect Ratio
Motorola XOOM 10.1" 1280 x 800 16:9
Samsung Galaxy Tab 7" 1024 x 600 16:9
Cruz T301 7" 800 x 600 4:3
Coby Kyros MID7005 7" 800 x 480 5:3
Dell Streak 5" 800 x 480 5:3
Archos 43 4.3" 854 x 480 16:9
So no standard width and height for images for tab in Android.
You can only think about that which size is suitable for those.
You can use 520*340 for 1280*800
500*320 for 1224*600
420*320 for 800*600
What are the most common screen resolutions: Android phones
320 x 480
480 x 800
480 x 854
540 x 960
1280 x 720
1920 x 1080
What are the most common screen resolutions?: Android tablets
1024 x 600
1280 x 800
1920 x 1080
2048 x 1536
2560 x 1440
2560 x 1600
found list of screen res via gravitylab
I'm working with camera preview frames, and need to make a decision about what minimum preview size I will work with. I need fairly high resolution, and am trying to figure out the highest preview resolution I can get across the more popular Android handsets and OS versions. (Judging by this question about Nexus One / Froyo preview sizes, it looks like they sometimes change across OS versions for the same device.)
Is there a resource anywhere that basically lists the output of android.hardware.Camera.Parameters.getSupportedPreviewSizes() for lots of different devices (or device/OS version pairs)?
Alternatively, if there is no such listing, this question could become such a resource. I will very happily upvote any answers that include new individual data points for specific handsets / OS versions.
And to forestall the obvious comment: Yes, I know I will need to test my code on lots of devices anyway. But ideally I would like to make some reasonably informed decisions about resolution early on, without having to purchase a bevy of devices just to get started.
My experience tells me, that 640x480 is available almost everywhere, and even if bigger resolutions are advertised by camera object, not all of them are actually usable.
I experienced segfaults on HTC Hero when I tried maximal resolution - data buffer used
for passing preview images is mmaped, and this size seems to be limited
HTC Wildfire running Froyo
1280 x 720 1.778
800 x 480 1.667
768 x 432 1.778
720 x 480 1.500
640 x 480 1.333
576 x 432 1.333
480 x 320 1.500
400 x 240 1.667
384 x 288 1.333
352 x 288 1.222
320 x 240 1.333
272 x 272 1.000
240 x 240 1.000
240 x 160 1.500
176 x 144 1.222
Lots of data here: http://www.kirill.org/ar/ar.php
My Nexus 9 running Lollipop has these front camera sizes:
1472 x 1104 1.333
736 x 552 1.333
1280 x 720 1.778
720 x 480 1.500
640 x 480 1.333
352 x 288 1.222
320 x 240 1.333
176 x 144 1.222
Nexus 4 running Icecream Sandwich
1280 x 720 1.778
800 x 480 1.667
768 x 432 1.778
720 x 480 1.500
640 x 480 1.333
576 x 432 1.333
480 x 320 1.500
384 x 288 1.333
352 x 288 1.222
320 x 240 1.333
240 x 160 1.500
176 x 144 1.222