5

In the case I have both values-xhdpi and values-large resources with which one will the galaxy note II work with? I don't have a device for testing and the emulator only takes me so far.

Any idea?

mmBs
  • 8,421
  • 6
  • 38
  • 46
Aviran
  • 5,160
  • 7
  • 44
  • 76

3 Answers3

7

According to the precedence table, large comes before xhdpi, therefore values from values-large will be used on the actual device.

An important note here, this happens if the device actually declares itself as having a large screen. However, devices are not very consistent about it, so I would consider adding resources to a folder like sw600dp because it is much more reliable. For more details read the link above and also check out how to use them in best practices.

Malcolm
  • 41,014
  • 11
  • 68
  • 91
  • is it normal for two different Note II devices to use different layouts? I have a device that goes with xhdpi and another that goes with large. the xhdpi one is using a custom rom.. so maybe that's the case. – Aviran Jul 09 '13 at 19:28
  • @aviran That's absolutely possible. That is exactly why I gave you the advice to use precise screen dimensions instead. – Malcolm Jul 09 '13 at 21:13
  • Keep in mind that Google's documentation naively assumes you don't want to support anything earlier than Android 3.2 – Cory Trese Aug 18 '13 at 21:35
  • @CoryTrese If you use qualifiers like `sw600dp`, that doesn't mean that the application won't run on anything earlier than Android 3.2 (read: on 2.3), it just won't be able to use these resources. But Android 2.3 doesn't support tablets anyway, so you won't have to worry about the screen size that much on earlier versions. – Malcolm Aug 19 '13 at 10:50
1

Here is a table of qualifer precedence:

http://developer.android.com/guide/topics/resources/providing-resources.html#table2

Android supports several configuration qualifiers and you can add multiple qualifiers to one directory name, by separating each qualifier with a dash. Table 2 lists the valid configuration qualifiers, in order of precedence—if you use multiple qualifiers for a resource directory, you must add them to the directory name in the order they are listed in the table.

Reading this part:

http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

It will find it in -large first and then ignore the -xhdpi one, so it looks like -large takes precedence over -xhdpi

Edit: someone else who agrees: https://stackoverflow.com/a/10685580/833647

Community
  • 1
  • 1
Ken Wolf
  • 23,133
  • 6
  • 63
  • 84
1

I've noticed, that for Galaxy S3 and S4

values-sw360dp

works.

Yar
  • 4,543
  • 2
  • 35
  • 42