Restrict sales of an app by specific devices?

我们两清 提交于 2019-12-05 08:40:42

I think you can do what you need in your AndroidManifest file. For example, you can choose to only support extra large screens resolution like this:

<supports-screens android:resizeable="false"
                  android:smallScreens="false" 
                  android:normalScreens="false"
                  android:largeScreens="false"
                  android:xlargeScreens="true"
                  android:anyDensity="true" />

These sizes are defined in the link below, for example "normal" is HVGA at medium density. Read the link below for more details.

http://developer.android.com/guide/topics/manifest/supports-screens-element.html

"If your application does not support small screens, then there isn't much the system can do to make the application work well on a smaller screen, so external services (such as Android Market) should not allow users to install the application on such screens."

You may also need to set the element, although I've not tried that myself, it seems to be in-line with what you want:

http://developer.android.com/guide/topics/manifest/compatible-screens-element.html

"The Android system does not read the manifest element (neither at install-time nor at runtime). This element is informational only and may be used by external services (such as Android Market) to better understand the application's compatibility with specific screen configurations and enable filtering for users. Any screen configuration that is not declared in this element is a screen with which the application is not compatible. Thus, external services (such as Android Market) should not provide the application to devices with such screens."

You'll want to read up more here as well to see what the Market does with all this info:

http://developer.android.com/guide/appendix/market-filters.html

Since I've not tried this, it's not clear to me whether your app should use both the elements I mentioned above, but the market filter page probably explains which to use.

This is covered fairly well in the developer documentation, particularly the pages linked to in the "See Also" box.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!