简体   繁体   中英

Release android app for handset only

How do I set an android app to be for handset only? I don't want my app to be available for tablets as the UI wouldn't really work for that large of a screen.

You must put all compatability information in your android manifest. If you do this, the android market will only show your app to devices that meet your requirements.

<compatible-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" />

    <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>

Just tweak it to your likings.

直接来自开发文档: 分发到特定屏幕

well, is there a specific reason for this. I haven't tried but someone once suggested me to use

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

but I would recommend having larger images or 9 patch images for larger screen and modified layout. You don't need to over do it but turn on some emulators of different sizes and play around with images and font sizes to get it right. Lastly, you can just find a way to install the app via Download and not share such links with Tablets. This isn't foolproof but can limit your users.

PS: Another way would be to have a spalsh screen in the beginning which can take up device measurements using getSize function usage and then either allow the device to show an error message for tablets or allow mobile users more access. All of this will result into grump tablets user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM