Hey Mark - Apologies, I misspoke on the newer devices. That part of the equation does work as expected for 3.2+ devices since smalles width is a higher priority selector.
You make a valid point about older devices with a single qualifier and how eliminating just flags the device didn't understand rather than the whole directory would make the resources look like default resources in that case, and cause overlap in others. It makes sense why it doesn't work the way I had hoped. The larger problem this creates is becoming more notable as higher resolution, larger screen phones become available. The biggest issue with the "5 directory" solution I posted above is that it allows newer handset devices that understand they are smaller than 600dp, but are physically large enough to report "large" will now drop into the wrong bucket (i.e the upcoming Droid DNA). The hope was that by combining the two into a single directory we could reduce code duplication and close those loopholes, but I'm not sure a solution exists here. Perhaps the only true is answer is two APKs on each side of the division line. Or maybe eliminating "large" as an option...if it's pre-3.2 and not a 10" tablet perhaps it deserves to run the same UI as the handset... If only there was a market qualifier to mask out specific versions so we could support 2.2 - 4.1 with a single APK, just excluding 3.0 and 3.1 ;p Dare to dream... On Wednesday, November 7, 2012 9:13:10 AM UTC-7, Mark Murphy (a Commons Guy) wrote: > > On Wed, Nov 7, 2012 at 10:38 AM, Dave Smith <[email protected]<javascript:>> > wrote: > > In my mind, the old devices that don't understand the "sw" qualifier > should > > just ignore its existence and the two directories should just look like > > "large" and "xlarge". > > If a directory has an unrecognized qualifier, the directory is > skipped; the qualifier is not simply ignored. Hence, older devices > will not "see" your -swNNNdp resources. You can demonstrate this by > taking a vanilla project, renaming res/layout/ to res/layout-swNNNdp/ > (for some likely value of NNN), and running it on an old emulator. > > > On the other side, with new devices, the "sw" > > qualifier should take precedence so the "large" and "xlarge" should > become > > irrelevant. > > Hmmm... > > I just ran a test on a project, where I changed it to have just one > layout resource directory: res/values-sw100dp-normal/. That directory > was picked up by a 4.0.3 WVGA800 emulator. Given your description, I > would have expected it to fail here with a ResourceNotFoundException, > since there is no place to fail over to. > > Do you happen to have a test project that demonstrates what you're seeing? > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 4.3 Available! > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

