android anydensity in manifest

后端 未结 2 633
南笙
南笙 2021-01-07 06:30

I have encountered an amazing problem, in my application.

When i put anyDensity tag false in manifest my application runs fine, but whenever i make it t

相关标签:
2条回答
  • 2021-01-07 06:59

    not too much info in your original post, however. The documentation states:

    Indicates whether the application includes resources to accommodate any screen density. For applications that support Android 1.6 (API level 4) and higher, this is "true" by default and you should not set it "false" unless you're absolutely certain that it's necessary for your application to work. The only time it might be necessary to disable this is if your app directly manipulates bitmaps

    So my first question is do you include all resources to accomodate any screen density (i. e. mdpi, hdpi, xhdpi, xxhdpi)? If yes, You should be fine. Following the last sentences of the quote above I arrived at this link.

    It says:

    An application can disable pre-scaling by setting android:anyDensity to "false" in the manifest or programmatically for a Bitmap by setting inScaled to "false".

    Have you tried doing it programmatically for your bitmaps, instead of disabling this flag globally for the whole app?

    And finally there is this section. Maybe it will be helpful to you in properly handling your custom bitmaps? Specifically, this paragraph sound like your problem:

    If your application creates an in-memory bitmap (a Bitmap object), the system assumes that the bitmap is designed for the baseline medium-density screen, by default, and auto-scales the bitmap at draw time. The system applies "auto-scaling" to a Bitmap when the bitmap has unspecified density properties. If you don't properly account for the current device's screen density and specify the bitmap's density properties, the auto-scaling can result in scaling artifacts the same as when you don't provide alternative resources.

    0 讨论(0)
  • 2021-01-07 06:59

    You can use the aapt tool, included in the Android SDK, to determine how Google Play will filter your application, based on its declared features and permissions. To do so, run aapt with the dump badging command. It will parse your application's manifest and apply the same rules as used by Google Play to determine the features that your application requires. For detailed information on using this tool, please visit http://developer.android.com/guide/topics/manifest/uses-feature-element.html#testing

    0 讨论(0)
提交回复
热议问题