Release android app for handset only

2019-08-05 07:21发布

问题:

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.

回答1:

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.



回答2:

Straight from Dev Docs: Distributing to Specific Screens



回答3:

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