简体   繁体   English

发布仅适用于手机的android应用

[英]Release android app for handset only

How do I set an android app to be for handset only? 如何将Android应用设置为仅适用于手机? 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. 您必须将所有兼容性信息放入Android清单中。 If you do this, the android market will only show your app to devices that meet your requirements. 如果执行此操作,Android市场将仅在满足您要求的设备上显示您的应用。

<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. 但我建议您使用较大的图像或9个补丁图像,以实现更大的屏幕和修改的布局。 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. 最后,您只能通过“下载”找到一种安装应用程序的方法,而不与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. PS:另一种方式是在开始时显示一个spalsh屏幕,该屏幕可以使用getSize函数使用情况来进行设备测量,然后允许设备显示平板电脑的错误消息或允许移动用户进行更多访问。 All of this will result into grump tablets user 所有这些都将导致脾气暴躁的平板电脑用户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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