Galaxy s4
Screen: 4.99", 1920x1080 (FullHD).
Which the res folder would be used in FHD and what's the dpi value should be set?
xhdpi or xxhdpi? And how can I calculate it?
I didn't find any info in the developer docs and in the screens_support article
It's 441 dpi, isn't it? So almost certainly xxhdpi, which is already supported in the Android framework. But why worry about it at this time? Assuming you're already supporting xhdpi, the likelihood that the average user can detect the different between xhdpi and xxhdpi assets is becoming increasingly small.
-- Edit --
Actually, I'd say it's certain to be xxhdpi, given that this is already in use with the new HTC One (which is at 468dpi).
Related
I'm about to adjust all drawables for an Android app for XXHDPI devices (like sony xperia Z and samsung s4). After thorough reading on Google's documentation, blogs, and SO, I'm confused as to the graphics I'm about to produce.
My concerns are the following:
Google states that I shouldn't worry about this density as it scales up XHDPI graphics - In the same manner, (before XXHDPI devices) why the production of XHDPI graphics was a necessity and it didn't scale up HDPI graphics?
Sony reminds developers not to exclude XXHDPI screens without clarifying if this concerns making adjustments to graphics - Do I have to redesign all graphic elements for XXHDPI?
Based on (2), Sony Xperia Z Ultra has 342dpi density but it is categorized as an XXHDPI device. - If I produce the graphics for an XXHDPI, which is twice the size of an HDPI density, the graphics will scale down by almost 1/3 to match Sony's density and this is undesirable. Why doesn't Xperia Z use the XHDPI drawables? What if I have a pattern and I can't afford any scaling since I'll lose the detail of the pixel-perfect pattern?
Are XXHDPI resources REALLY necessary?
I hope somebody can answer all the questions above.
EDIT
Below are the results of slightly scaling a graphic to adjust to various densities
- xhdpi image (1:1) no scaling
- xhdpi scaled up by 10%
- xhdpi scaled down by 10%
The detail loss is obvious at 2nd and 3rd image.
Unless you actually need your graphics to be "pixel perfect", scaling up from XHDPI will probably be fine for almost all cases. Pixels are so small the user won't be able to tell the difference. Do you actually have an XXHDPI device you can see your graphics on? You might have to provide XXHDPI resources for some drawables, just like you sometimes have to provide MDPI drawables when the HDPI ones don't scale down well.
"do not exclude" in this context means explicitly from the manifest. Some developers target densities in their manifest and that will affect the app not showing in the Play store, this is unrelated to actual graphics.
From that same page, it actually says that the density of that device is 440 dpi? - "One of the awesome features you’ll find in the recently announced Sony Xperia Z is its 5” screen, which boasts a display density of 440 dpi,"
XXHDPI resources are essential for stuff like icons on modern devices. Google will change their story and start to recommend them when they release their own XXHDPI Nexus device.
Think about it this way: xxhdpi devices are pretty much the STANDARD Android devices. Little chance Samsung & HTC are going to roll everything back to XHDPI just because Google can't keep up.
1) Android scales the drawables selecting the drawable that will produce the best result https://stackoverflow.com/a/14004691/936414
2) The post only asks you to include xxhdpi screen support in manifest. All XXHDPI devices take resources from XHDPI and scale them to fit accordingly. So no need of separate resources in XXHDPI folder
3) No need to include resources for XXHDPI.
So I got HTC smartphone with 800x480 display. I always thought that it is HDPI device. And I was ensured using the following code:
Display display = activity.getWindowManager().getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
display.getMetrics(displayMetrics);
displayDensity = displayMetrics.densityDpi;
it says my device is 240dpi. But experimentally I'd discovered that android threats my device only as MDPI. Im sure bout this. I tested the same with another 800x480 (ZTE) and result was the same - it shows 240 in displayDensity but android threats it as MDPI device... But why is it so? On android.devepoler they said that 240dpi is HDPI. I'm totally confused. Why the heck 240 is threated as MDPI?
How I'd discovered that android treats my HTC as MDPI device:
In short what I made to ensure - I put a big image to drawable-hdpi (guessing AOS gonna use it) and smaller one to drawable-mdpi and than ran an app to see which it gonna use. And it always used image from drawable-mdpi instead of drawable-hdpi. To know how which image looks like on my device I ran app previously putting images to drawable folder of project.
However, like I mention above, I was guessing that my 800x480 HTC is HDPI due to code based on displayDensity but not on Configuration. Configuration says my device is Configuration.SCREENLAYOUT_SIZE_NORMAL and seems like thats the reason why AOS treats my device as MDPI only. So in conjunction with DisplayDensity of 240dpi (which must be HDPI instead of MDPI) it really frustrating. So now the question is why with Display density of 240dpi Configuration sets device to MDPI type? Whats the reason of this? I was thinking that the one and only way to detect the device type is its display density. And if it is 240dpi it must be HDPI device instead of MDPI.
You may try to read this page: http://developer.android.com/guide/topics/resources/providing-resources.html , it shows a complete explanation about screen density and others when you want to organize your resource folder.
About device being treated like MDPI it may be like Nexus 7, we were sure that it was MDPI, but it was using images from HDPI and also some values from MDPI/sw600dp (things that you will find better explained at that link above there), because its density, actually was TVDPI and so it's a 'middle' density between HDPI and MDPI. Try to download an app called ScreenInfo, on GooglePlay. It shows various informations about device screen, and may help you to make sure about your HTC.
Hope it helps.
Sorry for delay, so, first of all, you have to decide which public you want. You have to keep in mind that there are inumerous devices around there and it's almost impossible to cover all of them. I'd advise you to start with devices considered normal(screen normal, and MDPI density) because that is the baseline. And then, worry about others, based on that first one. Understand that the differentiation on resources folders are only done if necessary. In most cases, resources used to baseline works well for everyone.
Hope it helps.
What simulator resolution i should keep when developing application for Samsung galaxy s2 and galaxy s3 ?
What i found that samsung galaxy s2 has 480x800 resolution and s3 has 1280x720 resolution so what i have understood up till now that I should ask my graphics designer to provide me hdpi graphics that contain 480x800 background images and to implement same background image in galaxy s3 mobile, I will use image of size 1280x720 and put in xhdpi folder so that it can work on s3.
The background image is something which covers whole available area for mobile app. so am i right ??
You will need to create several emulators or get various devices.
There are some pretty important ones, so generally you need to make sure you have:
ldpi, mdpi, hdpi, xhdpi
and
small, medium, large, xlarge
Some people choose to exclude certain sizes (like small and ldpi) but htat's up to you,
if you go with some or all of the following, it should be a good start:
480x320 (SE Mini 10), 480x800 (GS2, Desire, etc), 1280x720 (GS3, Galaxy Nexus etc), 1280x800 (Note, Xoom, various other tablets)
HTC ChaCha (because it's landscape default)
You need to make sure you create resources in the relevant folders for each density, usually, I tend to ignore ldpi and just put resources in:
mdpi,hdpi and xhdpi (mdpi will be scaled down for ldpi devices,
automatically)
You may also need to create various portrait and landscape layouts in different sizes.
Reading this page provides most of the necessary information:
http://developer.android.com/guide/practices/screens_support.html
This page also contains important information regarding size distribution and popularity that is constantly up to date:
Android Stats
One thing that Android does for you is that it manages resolution. If you use the proper size formats (dp, sp, etc), your layout will scale to almost all resolutions. If you place images in the proper drawable folders (hdpi, ldpi, mdpi, etc), the OS will also swap those out as necessary.
Also, the emulator should handle resolutions for specific devices, if I recall correctly.
Desing lazout in smart way! Usualy it means don't put to mutch content in one layout.
Make sure that evrything looks good on smallest size and bigest size. It is better to treat tablets separetly. Read how providing alternative resources works, you can build sepereate layouts for each screen size.
Check if the hardware is available on that device before using it. hasSystemFeature() can be used for checking.
There's no such density as "xxhdpi", right? (I know there's "xhdpi", of course). I've got a partner asking for assets in that density, but I cannot find any documentation on that. Have I missed this somehow? Is there a complete list of all known density names? I don't see anything in here, xhdpi is the largest mentioned:
http://developer.android.com/guide/practices/screens_support.html
Thanks
There is xxhdpi from API 16 (jelly bean). You can find it in the newest version of ADT.
It seems that the dpi range of xxhdpi should between 400dpi-500dpi (I guess so), one of the evidence is that the HTC J Butterfly (or HTC DLX) uses xxhdpi and the screen is 441dpi.
In some cases, lower dpi devices may use higher dpi assets to display contents in a bigger size. For example, xhdpi Nexus 10 uses xxhdpi launcher icons.
References:
Official G+ shows that xxhdpi is 480dpi:
https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW
ADT shows xxhdpi support:
As of ICS xhdpi is the highest density supported. You could of course name a folder layout-xxhdpi and put it in your resources directory, but I don't think android would know what to do with it.
(Note: I don't know if this is correct for Jelly Bean)
EDIT:
From Jens' comment I see that there are constants (added in Jelly Bean) for XXHIGH density. However, it says that applications likely won't need to worry about this as XHIGH graphics can be scaled up. I still don't see any information about something like a layout-xxhdpi folder, but perhaps those documentation pages simply haven't been updated yet.
I can't figure out how to produce drawables for the new "high-res" handhelds like the Galaxy Nexus, One X, Galaxy S3 etc that have a resolution of 1280x720 or higher.
I always try to make as few layout-versions as possible. Preferably just one but at times a layout-long and notlong is necessary. And make the xml smart enough to handle all devices. But that's only possible if the drawable resources are there to supply all the different resolutions and sizes.
All has been nice and smooth until the new big phones arrived and I find that the drawables are to small for them. No xxhdpi-folder yet from Google so I must be doing something wrong.
I know it's forbidden to mention pixels here but still you have to use photoshop or some other pixel based application to make the drawables. Therefore you need to know how big to make these drawables.
This is what i've done so far:
xhdpi: 640x960
hdpi: 480x640
mdpi: 320x480
ldpi: 240x320
The problem is that when a 1280x720 device gets the drawables from the xhdpi folder things starts looking bad, the images are too small and there's too much space between them.
What do you base your drawable source files on? xhdpi in 1028x720? That messes up the lower res versions for me.
I have an ad agency breathing down my neck wondering why it doesn't look as perfect as on the iPhone...
Well, as I said above I can't find any handhelds with Android on it that's got a resolution of 640x960. So I based all my images on 720x1280 instead and put the 640x960 resolution stuff in a large-hdpi folder.
Now my app looks great on the latest Nexus, the Galaxy S3, HTC One-X and all of the other newer hires models. I think the tablets when looking for resources will go for large first, then hdpi where they will find the 2x scaled images.
This is what I ended up with:
xhdpi: 720x1280
large-hdpi: 640x960
hdpi: 480x640
mdpi: 320x480
ldpi: 240x320
I have a Galaxy Nexus, and I use the xhdpi resource folder (at a 2.0 scaling factor) and the images look great. Do you have an example (screenshot preferably) of what issue you're having? If you're hardcoding spacing and sizes in pixels, then yeah, it'll probably look weird at higher densities. Are you trying to hardcode a background image 1:1 at a specific pixel size? If so, that's never a good idea on Android.