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.
Related
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
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
FHD(Full HD) is 1920*1080.
Which the res folder would be used in FHD and what's the dpi value should be set?
The Smallest width is configured by manufacturer, so it may be varied. For instance, Nexus 7 and Kindle Fire HD both have 1280x800 screen resolution, but the smallest width of N7 is 600dp, while Kindle Fire HD is 533dp.
Here is a way to calculate this:
If 480x800 is mdpi(160) for 5 inch device, the screen dpi(screenDPI) of the device with resolution 1080X1920 is 160*(1080/480)=360 (NOTE: manufacturer might change this number). Then the smallestWidth = 1080/(screenDPI/160).
Use Configuration to find out all the information of the device.
It depends on the screen size because a 7' screen with FHD will not have the same dpi as a 17' screen with FHD. to know DPI I use this calculator :
http://members.ping.de/~sven/dpi.html
and for the folders please try the actual google documentation it is pretty complete:
http://developer.android.com/guide/practices/screens_support.html
hope it helps!
I have both hdpi and xhdpi folders in my res folder. However, android makes use of hdpi xml file for 1280 X 800 resolution of a tablet. Could it be because my xml file accesses resources which are in drawable-hdpi folder but not in drawable-xhdpi folder?
I think you are confused with DPI vs screen sizes, which resolution along does not provide. You can have a XHDPI device with a small screen that is very high resolution (such as the Galaxy S3) or a MDPI or LDPI device with a very large screen (such as when you use Android on your TV).
Generally speaking, Dot per pixel = Resolution / Screen size.
Not all android devices are set to the right density by the manufacturer, its really a hodgepodge of densities no matter what resolution you think you have, the device could still be seen by the android OS as a lower or different density than you think
if the android OS thinks your device is HDPI then it will access HDPI drawables
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.