difference between and on Android

后端 未结 3 520
情话喂你
情话喂你 2020-11-30 10:58

I am now officially confused about the difference between the two manifest elements and

I thought that by ONLY using Google Play will filter out devices that do

3条回答
  •  遥遥无期
    2020-11-30 11:44

    Yes, Google make it confusing, their documentation needs a lot of work. They say how to make it for specific screen sizes using "compatible-screens", then use supported-screens in a different situation. I thought this paragraph here helps make it clear about the impact of using compatible-screens element in your manifest, (emphasis mine):

    In such a case, you can use the element to manage the distribution of your application based on combinations of screen size and density. External services such as Google Play use this information to apply filtering to your application, so that only devices that have a screen configuration with which you declare compatibility can download your application.

    The element must contain one or more elements. Each element specifies a screen configuration with which your application is compatible, using both the android:screenSize and android:screenDensity attributes. Each element must include both attributes to specify an individual screen configuration—if either attribute is missing, then the element is invalid (external services such as Google Play will ignore it).

    What's confusing is they add this note afterwards

    Note: Although you can also use the element for the reverse scenario (when your application is not compatible with smaller screens), it's easier if you instead use the as discussed in the next section, because it doesn't require you to specify each screen density your application supports

    "Easier" is relative to your needs, which is what confused me. Then they go on and say this (emphasis mine):

    Caution: If you use the element for the reverse scenario (when your application is not compatible with larger screens) and set the larger screen size attributes to "false", then external services such as Google Play do not apply filtering. Your application will still be available to larger screens, but when it runs, it will not resize to fit the screen. Instead, the system will emulate a handset screen size (about 320dp x 480dp; see Screen Compatibility Mode for more information). If you want to prevent your application from being downloaded on larger screens, use , as discussed in the previous section about Declaring an App is Only for Handsets.

    So it seems that "compatible-screens" will force Google play store to filter according to screen configuration. The "supports-screens" element affects your device's screen-compatibility mode, which is different from "compatible screens".

提交回复
热议问题