I have a bit confused with the qualifier. I am dealing with kindle fire 7" and 8.9, galaxy s4.
Kindle Fire 7inch: I need to use values-large-hdpi instead of values-sw600dp in order to work.
Kindle Fire 8.9inch: I can use values-sw600dp not for values-large-hdpi.
Galaxy s4 what qualifier should I use.
the qualifiers refer to what the screen dimensions are. So values-large-hdpi will apply to screens that have a minimum density of hdpi and are classified as a large screen type. The sw600dp means that the in order to use those values the screen must have a minimum width of 600dp. So my guess is that the Kindle Fire 7 inch does not meet the sw600dp requirments (Try holding it in landscape, that might work). But the 8.9 inch (being larger) would meet these requirements. The Galaxy s4 my guess falls into the xhdpi density range, not sure about screen size. Most phones will use normal, but the s4 having such a large screen might qualify to large. I would recommend using a screen width quantifier anyways, as just using hdpi or large is to vague.
Related
In order to support different screen sizes in an Android App, I have created different layout versions: sw320, sw480 sw600 sw720
But I notice that many mobile smartphones takes the version of sw320 while they do represent the page differently.
For example when running on the following devices:
Nexus One and
Samsung Galaxy s7
both takes (from some reason) the sw320, Why is that?
And would it be reasnable to add more layout versions to the code?
Nexus One and Samsung Galaxy s7 both takes (from some reason) the sw320, Why is that?
The Nexus One was an hdpi device with a screen resolution of 800 x 480 pixels. Its shortest width is 480 pixels, which is 320dp.
The Samsung Galaxy S7 should be an xxxhdpi device, and its screen resolution is 2560 x 1440. Its shortest width is 1440 pixels, which is 360dp.
Hence, both devices fall within your -sw320dp bucket, given your other buckets.
And would it be reasnable to add more layout versions to the code?
IMHO, you should have fewer versions, not more. You should be using layouts that are more fluid and can adapt to small variations in screen size. Having different layout resources entirely should be reserved for cases where a major change in UI is called for (e.g., the classic master/detail pattern implementation, between phones and tablets).
I tried to create an emulation of the Samsung Galaxy II i9100. All I really care about is screen size and pixel density. I created the following device definition:
And this virtual device:
But the emulated device looked like this:
Why was the resulting size 480x736? And the dpi value is slightly off.
ETA: here is what my app looks like:
And here is the output of ShowResources on an actual Samsung S2 i9100
First Galaxy S2 is HDPI, not TVDPI, also note that TVDPI is not a "primary density group" per Android documentation:
Resources for screens somewhere between mdpi and hdpi; approximately
213dpi. This is not considered a "primary" density group. It is mostly
intended for televisions and most apps shouldn't need it—providing
mdpi and hdpi resources is sufficient for most apps and the system
will scale them as appropriate. If you find it necessary to provide
tvdpi resources, you should size them at a factor of 1.33*mdpi. For
example, a 100px x 100px image for mdpi screens should be 133px x
133px for tvdpi.
source: http://developer.android.com/guide/practices/screens_support.html
On why the screen report 480x736, the 64 pixels is used by the system soft buttons (back, home, recent apps). To remove the soft buttons, you have to use/create a Device Definition that sets Buttons option to "Hardware", as exemplified below:
Alternative you can use Nexus S's Device Definition, it would have the correct buttons and DPI settings.
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!
As you know Samsung Galaxy Tab's (7.4") screen resolution is 1200x600 and dpi is 160 normally, but Samsung reports its density 240 dpi.
So, i created hdpi graphics for galaxy tab and put them in drawable-hdpi folder.
But i noticed that after install custom ICS rom to Galaxy Tab, galaxy tab starts to report its density 160 dpi. So it show mdpi graphics.
I wonder could i do something in my application to handle this special situation; because i know i replace drawable-mpdi graphics with drawable-hdpi graphics, lots of device will have problems with app, this time.
If it is only for the situation explained above, you can use the "Platform Version" qualifier. (Refer to Providing Resources)
drawable-v14 for ICS and accordingly for other versions. You can also use drawable-hdpi-v14 for fine grained control.
I take it you are talking about the GT-P1000, and it is the only exception to have HDPI density instead of MDPI for that size. I use drawable-large-HDPI for it next to a drawable-large-MDPI folder for all other similar sized tabs and thus have different resources for both.
I am considering to drop support for small screens in my app.
Recently I have stumbled upon Screen Sizes and Densities and currently (2011-10-01) it says that 3.5 percent of the active devices fall into the small/hdpi category. I wonder what device actually has a small screen with high pixel density?
I know of the HTC Wildfire which has 240 x 320 pixels, 3.2 inches (~125 ppi pixel density). If I understand correctly that would be an ldpi device. For my app the Wildfire has a share of somewhere around 2 percent.
So first, why does Screen Sizes and Densities not list anything under small/ldpi? And second, what would be an example of a small/hdpi device?
There are some device from Dell like Aero which comes under small/hdpi.
HTC Tattoo can be considered under small/ldpi
Just to add to Basavraj's answer, Guessing the screen size is not that simple. Like Galaxy note has 1200 X 800 screen dimensions but it's screen size falls in large(and not in extra-large) category.