您的位置:首页 > 移动开发 > Android开发

android-Distributing to Specific Screens

2015-12-26 01:15 483 查看
Although we recommend that you design your application to function properly on multiple configurations of screen size and density, you can instead choose to limit the distribution
of your application to certain types of screens, such as only tablets and other large devices or only handsets and similar-sized devices.

Here's what the manifest entry looks like if your application is compatible with only small and normal screen sizes:
<manifest ... >
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
...
<application ... >
...
<application>
</manifest>

<manifest ... >
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
...
<application ... >
...
</application>
</manifest>

Caution: If you use the
<supports-screens>
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
<compatible-screens>
,
as discussed in the previous section about Declaring
an App is Only for Handsets.

>Although we recommend that you publish one APK for your application, Google Play allows you to publish
multiple APKs for the same application when each APK supports a different set of screen configurations (as declared in the manifest file).

If you need more information about how to publish multiple APKs on Google Play, read Multiple
APK Support.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: