Is there a way to create a drawable folder and a values folder to 420 dpi and 560 dpi devices? One for the 420 dpi and one for 560 dpi.
420dpi: Samsung Galaxy S5, S4, LG G5, ...
560dpi: Nexus 6, Samsung S6, S7, ...
Because in those type of devices my app not looks well. Images in drawable-xxhdpi are smaller in a device with 420 dpi. Because multiplies the width of the image x 2,625 (density). I need bigger images or multiply images x 3.
The solution that I've found is to create a drawable-420dpi and a drawable-560dpi folder and copy xxhdpi and xxxhdpi resources respectively.
I'm not sure that this is the best solution but It works on PIXEL XL, Nexus 5X, 6 and 6p simulators.
This is very frustrating for developers and designers too.
If you using Android Studio, you can easily create a folder width name: mipmap-420dpi and mipmap-560dpi in the folder that same with folders as mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi .... You can see this picture
You can get ppi using DisplayMetrics and after getting ppi you can use IF condition and set that drawable that you need to set.
Related
I have added one splash screen image(1440 X 2560) in background. When I run the app, I see the image as stretched for the Samsung S8(All xxx devices).
Samsung Galaxy S7 resolution: 1440 x 2560 - XXXHDPI
Samsung Galaxy S8 resolution: 1440 x 2960 - XXXHDPI
The issue is if I am adding image(1440 X 2960) in a drawable-xxxhdpi folder, then image will be compressed for Samsung S7, and if I am adding image(1440 X 2560) in a drawable-xxxhdpi folder, the things will be bad in Samsung S8 device.
Is there any way through which we can manage the different images in our resources folder for different XXXHDPI devices?
I tried my way and it worked, try to create a drawable-long-xxxhdpi folder in res and put the 1440x2960 pixel image there. Hopefully can
I'm trying to set up specific values/drawable folders for all screen devices but it is quite complicated, for example I have 2 similar phones :
HTC Pixel which has resolution 1920x1080 (screen size 5") and,
HTC 5X which has same 1920x1080 resolution (screen size 5,2").
For this type of phones I have values-xxhdpi and also same folder for drawable drawable-xxhdpi. Should this phones use same folders? because on both looks it differently and this is quite strange.
So, as far as I know, we can use next formula:
density = SQRT(width*width+height*height)/screen_size.
For example, Nexus 6 (6.0", 1_440*2_560) should give 490 dpi (approx.), but Android Studio Preview screen shows this device with 560 dpi.
What am I missing?
Although each device has its own screen density, Android includes the device into the nearest density "bucket":
420 dpi
560 dpi
xhdpi
xxhdpi
As seen in Android Studio:
Although the Nexus 6 and 6P have different physical screen densities, the same drawable resource will be used for both devices.
About the Nexus 6, the manufacturer density is 560 but the physical density is about 493. Always think about the manufacturer density before think scale factor.
Are there xxxhdpi density devices?
Android devices screen density increases (see https://github.com/paulvi/displayclasses) and there are already devices with density higher than xxhdpi (extra-extra-high) ~480dpi
like Samsung Galaxy S6 577 2560 1440
(But I cannot check if it is really xxxhdpi)
Is it time to prepare 192x192 icons?
(4x times 48x48 dp, see http://developer.android.com/design/style/iconography.html )
See also Android Official Icons for XXHDPI and XXXHDPI
UPDATE: Was asked a year before as Android xxx-hdpi real devices
Also Nexus 6 and Nexus 9 Screen density
Just for reference purpose, now Google maintain a list of devices density and other information at https://design.google.com/devices/ which is mainly targeted for material design guideline.
Are there xxxhdpi density devices?
Afaik Nexus 6 is xxxhdpi device
New phones already use XXXHDPI.
Our test phone Samsung S6 Edge use xxxhdpi drawable resources. Someone already mentioned that Nexus 6 also using this dimension. Thus new phones with good screen should use this dimension.
xxxhdpi density devices Resolutions :
2048x1536
2560x1536
2560x1600
In Nexus 6
For more help :
http://developer.android.com/guide/practices/screens_support.html
Actually, no, even as of 2016, there are still no xxxhdpi device.
The largest resolution on Android device is used by Xperia Z5 Premium (4k on 5.5", or roughly 806ppi), and even on that device, it was only used that humongous screen density for multimedia contents. The UI itself was rendered by halving the effective density by two, so it actually scales down from 4k to full HD on 5.5", or xxhdpi.
Specs for Xperia Z5 Premium : http://www.gsmarena.com/sony_xperia_z5_premium-7536.php
I found 8 corresponding devices here.
My Samsung S22, released in February 25, 2022, has a 600 dpi when resolution is set to its highest (3088 x 1440), and more importantly, it loads xxhdpi resources, which means that we aren't there yet in terms of smartphones with 640 DPI or more screen density, and even if your phone contains 600 dpi like my S22 does, which is just 40 dpi shy off 640, it'll still load the 480 dpi (xxhdpi) resources.
I guess we'll get to 640 dpi in a year or two, I also expect the AOSP to add a xxxxhdpi to the source code very soon just as xxxhdpi was added in 2013, long before any 640 dpi handset was released.
Kindly I want to know why Galaxy S3 and S4 get the images from this folder (drawable-sw360dp-xhdpi)??
all images seem very large for these devices !
also If I make these images smaller they will not be suitable for larger devices !
Please, what is the solution?
I assume you are using layouts for 10 inch and 7 inch devices are layout-sw720dp and layout-sw600dp then you just create drawable-sw720dp and drawable-sw600dp, also in the case of high density for those xlarge and large screen devices then append the corresponding density to the drawable folder . For example use drawable-sw600dp-hdpi for high density 7 inch tablets like ASUS MeMO Pad HD 7'. Now resource for large and xlarge are solved
Now Consider the drawable-sw360dp devices.
drawable-sw360dp/layout-sw360dp are for phablet devices like Note1,Note2, Micromax CanvasHD,S3.
The above mentioned devices are XHDPI devices. For using drawables either you can use drawable-xhdpi or use drawable-sw360dp-xhdpi
Thus you can distinguish resources for s3,s4 from xlarge and large screen devices.
Note : S3 and s4 taking images from drawable-sw360dp-xhdpi because smallest width of those devices are 320dp. You can check the device display information by installing screen info app from the playstore.
check screen info app here
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
http://developer.android.com/guide/practices/screens_support.html
It is based on the dpi
even now there is a xxhdpi folder or I may be wrong on that one??? Some one else to confirm that?