xlarge vs sw720dp screen size confusion

For reference: http://developer.android.com/guide/practices/screens_support.html

The old style size quantifiers are “deprecated”:

  • Using try/catch for preventing app from crashes
  • What is the difference between `opencv.android.JavaCameraView` and `opencv.android.NativeCameraView`
  • fabric.js resize canvas to fit screen
  • Is there any reason to use the support.v4 library in Android?
  • How to change the style progerssbar in SwipeRefreshLayout?
  • Android mediarecorder stop failed
  • A set of four generalized sizes: small, normal, large, and xlarge
    Note: Beginning with Android 3.2 (API level 13), these size groups are
    deprecated in favor of a new technique for managing screen sizes based
    on the available screen width. If you’re developing for Android 3.2
    and greater, see Declaring Tablet Layouts for Android 3.2 for more
    information.

    I was hoping that devices with 3.2+ would still use resources declared in drawable-large-mdpi, or layout-xlarge, but this doesn’t seem to be the case.

    I have a test project that contains a layout file for each of these sizes:

    • layout-sw600dp
    • layout-720dp
    • layout-xlarge
    • layout

    On a 10″ Motorola XOOM running Android 4.0.x, the device picks the layout in the layout-720dp folder. If that folder doesn’t exist, it picks the layout in the layout-sw600dp folder! Why doesn’t it pick the layout in layout-xlarge?

    Even more strange, is I have drawables in these folders:

    • drawable-sw600dp-mdpi
    • drawable-xlarge-mdpi

    The 10″ Motorola XOOM from above, picks the image from drawable-sw600dp-mdpi. Why doesn’t it pick the drawable in drawable-xlarge-mdpi?

    Should we not expect the xlarge quantifier to work at all above Android 3.2?

    Does this mean I have to duplicate all assets in the drawable-xlarge-mdpi folder, into the drawable-sw720dp-mdpi folder? (To support Android 3.0, 3.1 AND 3.2+?)

    Hopefully I am just missing something simple here. Please advise.

    Related posts:

    How to give percentage values in ObjectAnimator in Android
    android audio distortion on square waveform
    Reserve internal storage of Android device for future application critical logs
    How to stop youtube video playing in Android webview?
    Android: customizing the look of Tabs using TabHost & TabWidget
    How to create Spinner-list using CustomAdapter in android
  • Android Custom Shape Button
  • ListView not refreshing already-visible items
  • How can I implement a Material Design Expand/Collapse List on Android?
  • Google Play Alpha App BM-PPH-01 Error
  • What is 'Evolutionary Development Methodology'?
  • android: how do I format number as phone with parentheses
  • One Solution collect form web for “xlarge vs sw720dp screen size confusion”

    From my understanding, for Android 3.2+, if you have at least one folder that uses the new size quantifiers then it assumes that you are using these new size quantifiers everywhere. So this is the reason why it ignores layout-xlarge or any other folder that uses the old quantifiers.

    With regard to backward compatibility, you’ll have to use in your project both types of quantifiers. The old ones will be used for API < 3.2 and the new ones for API >= 3.2. To avoid duplication, for the layouts you can use aliases. However, for drawables, I don’t know of any solution to avoid duplication.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.