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.
Related
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.
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?
I've run into a formatting issue regarding the Galaxy S and Galaxy S2. Perhaps someone can share some insight. When testing my app on the two emulators which I downloaded from the Samsung site, the emulator pulls graphic resources from the drawable-xhdpi folder and the graphics are way too large. I confirmed this by setting different graphics in each drawable-<density> folder. The phone specs for the S2 are 480 x 800 pixels, 4.3" screen size (works out to ~217ppi screen density) so I would expect the emulator to pull from the hpdi folder. The emulator setting for the the S2 declares an abstracted LCD density of 300 while hw.lcd.width and hw.lcd.height are 480 and 800 respectively. Is the abstracted LCD Density set incorrectly by the manufacturer and should I change it in the hardware settings to 217 to get an accurate representation on the actual device? I haven't been able to test on a Galaxy S or S2 device and I'd hate to have to write a special case to deal with a particular phone type as this is bad practice.
I have developed a clock widget. And I only have 1 res/layout and 1 res/drawable. Everything works perfectly.
It works on mdpi like Samsung Galaxy Ace. It works on hdpi like Samsung Galaxy S2. It works on xhdpi like Samsung Galaxy Note.
However I got ugly look on 720x1280 devices such as Samsung Galaxy Nexus or Sony Xperia S. And coming soon Samsung Galaxy S3.
When I provide res/layout/xhdpi which I built specifically for 720x1280 devices and then Galaxy Note will also use this layout and it looks ugly on Galaxy Note.
How to address this issue?
It is like some crossing between 720x1280 (Galaxy Nexus, Sony Xperia S, Galaxy S3) and 800x1280 (Galaxy Note).
The resolution and DPI of the device don't necessarily match up (high resolution doesn't mean high DPI). DPI is a ratio of the resolution of the device and its physical dimensions.
Instead of separating your layout folders by DPI, separate them by dimensions. For instance, layout-large, layout-xlarge. You can also quantify by specific sizes, such as layout-w720-h1280, in which case that would match only device with a minimum width of 720 pixels and minimum height of 1280 pixels.
Use layout-sw320dp for Galaxy S3
Ideally I'd have a heap of physical devices to test on, but in reality I don't have access to devices with all the different characteristics.
I'm targeting Android 1.6-current (4.0.3 at the moment), primarily phones, but also want the app to be at least somewhat usable on tablets.
The configurations I've been usually testing with until now:
Android 1.6, 320x480 MDPI
Android 2.2, 480x800 HDPI
Android 4.0, 480x800 HDPI
(landscape and portrait, with and without network connection)
I'm thinking of a set of configurations that wouldn't be excessively large but still would give good coverage of various devices "out there". What Android emulator configurations would you suggest?
Update:
Based on the answers I added this configuration to the list:
240x320 LDPI (QVGA skin)
Important to note is that it has 3:4 aspect ratio, different from 3:5 that WVGA has. If layout is tuned to just barely fit in WVGA, scaling down to QVGA can reveal problems. Good idea to check!
Also, added simulated Galaxy Nexus. Just to realize from now on I'll need xhdpi graphics (blurry icons: not acceptable!):
720x1280, no hardware buttons (WXGA720 skin), no SD card
What about 240*320 ldpi ? like xperia mini, motorola, cliq
Well, I'd suggest you add LDPI configuration (which is QVGA - 320x240 and has 0.75 density) as far as there are a lot of devices with such screen resolution.