what's the folder name for 1080p resource on android? - android

what's the folder name for 1080p resource on android?
I know mdpi support 320x480
hdpi support 480x800
xhdpi support 720p

Unfortunately it isn't that easy. Mdpi, hdpi and xhdpi are all select based on screen density - basically the size of the pixels - not the number of pixels. So, if your 1080p screen is very large, it could conceivably be an mdpi screen (yes, it happens). You have the alternative to use small, normal, large and xlarge as selectors but these aren't tightly defined. A 1080p screen should be xlarge but so should a 720p.
The document at http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources is useful.

This is a poorly worded question, but it seems like you are trying to support the new 1080 x 1920 phones coming out. The maximum pixel density that Android supports is 480 dpi, which is called xxhdpi.
A phone (3"-5" diagonal) at 1080 x 1920 will fall into the xxhdpi density, like the Samsung Galaxy S4 at 441 dpi. However, a tablet (7"+) at 1080 x 1920 will not be xxhdpi, so do not assume that density correlates to resolution.

You can clear about the Screen size, density pixels in android. I found tutorial Tips for designers and developers Android

Related

HDPI, LDPI, MDPI

Sorry. I have no idea about Android screen size HDPI, LDPI, MDPI. How can I check my flutter app in these screen size?
Create new android emulators with different pixel densities, and run the app on them. I wouldn't worry about ldpi (.1% of devices). The cutoffs are 160 dpi (mdpi), 240 dpi (hdpi), 320 dpi (xhdpi) and 480 (xxhdpi).
Generally this shouldn't be a problem as long as you specified all your sizes in dp rather than pixels. The most likely thing to want to change is images, make sure that any non-vector image looks good at multiple resolutions.
HDPI, LDPI, MDPI all refer to the pixel density of your display and not resolution of the device.
Generally when developing for multiple screen sizes you should focus more on viewport (say 360dp and 600dp as your breakpoints), then find or create new android virtual devices that match your viewport and then run your app on those devices.
Here are a few good links:
Material IO Pixel Density
Android Documentation
Android Device List

Android Form Factor Metrics

I cannot find the answer to this question anywhere on or off stack overflow:
Google defines common sizes and densities for devices as follows:
Sizes:
xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp
Densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
My question is:
Which of these sizes corresponds to mobile phone devices? None of the sizes are portrait (height > width).
Say you are trying to figure out what dp to make a full screen bitmap to accommodate all mobile devices...
Generalizing a lot:
For phones (in portrait mode, width by height)
ldpi was typically 240 by 320
mdpi was typically 320 by 480
hdpi is typically 480 by 800 or 480 by 854 and lately 540 by 960
xhdpi is typically 720 by 1280 or 800 by 1280
xxhdpi is typically 1080 by 1920
xxxhdpi is typically ? by ? // who knows that? Feel free to edit, if absolutely sure.
For tablets, it's totally different.
But you asked for phones only.
You can't make best bitmap for all devices.
Many manufacturer set density via build.prop file ro.sf.lcd_density
so tablet could act like phone.
It's better to get current device values with getResources().getDisplayMetrics() and go with it.
You can set ImageView as background and continue with cropping options:
ImageView.ScaleType
After reading the Supporting Multiple Screens Android documentation several times over, and brainstorming a lot, I believe I have identified a couple of ways Google would like developers to generally go about this.
Legacy Solution:
Primarily, they wanted developers to use these small, normal, large, xlarge size qualifiers for drawable/ resource directories to allow Android to pick the correct resource to use.
I think the important thing to notice here, and I could be wrong, is that maybe they originally didn't want developers to have worry about whether the dimensions for these small, normal, large, xlarge sizes apply to a phone or tablet, but rather know they apply to both.
The caveat with that, of course, is that a full-screen image with landscape dimensions (width > height) will not look the same on a portrait device (height > width).
The solution using the legacy method would be to use an ImageView and set it's ScaleType appropriately, so it crops your tablet-sized image on mobile devices.
But there is another possible solution...
Alternate Solution:
There is a also a section on "New Qualifiers" for supporting different screen configurations. In this section, Google details qualifiers such as smallestWidth or available width, that could in theory, be used on your drawable/ resource directories to define proper portrait or landscape resources for your available device width.
For those familiar with web development, these qualifiers are the equivalent of CSS media queries.
As for specific widths to use, Google details some typical configuration examples:
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800
hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
The only doubt left in my mind is that all of their examples use these qualifiers for layout, but not drawable resources. It begs the question whether this is the defacto solution they want developers to use for the given problem.

Android xhdpi density and resolution

I'm a bit confused and i hope you can help me. I'm developing an application for smartphones and i'm using prefixes like: mdpi, hdpi and xhpi. With first two i don't have any problems.
According to this:
http://developer.android.com/guide/practices/screens_support.html
and this
http://developer.android.com/about/dashboards/index.html
xhdpi is 640x960 px screen size and I have prepared my graphics for this resolution. But I can't find any device with this resolution. Instead of this, in android layout editor I have, for example, Galaxy Nexus which is marked as xhdpi device, but it has 720p screen size.
So my question is, I should look at this tables from documentation and believe that 25% devices has screen of size 640x960 px or I should change my graphics to the 720p screen size ?
If you develop only for phones and tablets for you is unnecessary you may not use xhdpi folder for your resources. If you want that your app works fine on modern devices such as Galaxy Nexus, Nuxus 4, etc you should support xhdpi screens.
large screens are at least 640dp x 480dp (hdpi)
xlarge screens are at least 960dp x 720dp (xhdpi)

how to design tablet ui with high resolution but less density screens?

I want the emulator to make use of the files present in the xhdpi folder and at the same time it should have low density. My emulator is set to a resolution of 1280 X 800 similar to motorola xoom tablet. Now if i keep a density of 149 ppi, android does not access the xhdpi folder. Please help. TIA.
Do not misunderstand Screen size, Screen density and Resolution. Read this article first.

Android Multiscreen Support issue

hi guys i have been developing android app that should match most of the screen resolutions. And i just got struck at setting the drawable folder for this two resolution
1. 480 x 800 with approximate density of 217
2. 540 x 960 with approximate density of 240
And i have a different set of images for both the resolutions and i have set hdpi for 540 x 960 but don't have an idea of going about the 480x800 which also falls under hdpi. After goggling found a drawable qualifier called tvdpi which supports the appr. density of 213
When i set the tvdpi qualifier to the drawable folder i get "invalid resource directory name" error
Resolution and dpi are not directly related. It just so happens that many 800x480 devices are HDPI, then can just as easily be low dpi though if the screen is big enough.
If you really need direct resolution matching you will need to target API level 13 and use available width and height qualifiers for your resources or if you need to target a lower API level than 13, create your own resource loading scheme.
You can also use a combination of density and size qualifiers but that still leaves some room for two different resolutions falling into the same bucket.
But before you pick, you need to ask yourself do you really want the same pixel size for your drawables on a 3.7" 480x800 screen as you do for a 7" 480x800 screen.

Categories

Resources