我在Play商店发布我的应用程序,我不希望它可用于平板电脑.我怎样才能实现呢?
我不想手动排除android开发者控制台中的每一个平板电脑,但我真的需要我的应用程序专门在智能手机上运行.
编辑:我按你的建议做了,但结果如下:

并进一步解释:我需要我的应用程序在普通人称为智能手机的设备上运行,而不是在普通人称为平板电脑的设备上运行...例如,它必须在"Galaxy Note 2"上运行,而不是在"Galaxy Tab"上运行
已解决感谢@CommonsWare:
我必须在清单中设置以下标记:
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9"/>
Run Code Online (Sandbox Code Playgroud)
和:
<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" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
</compatible-screens>
Run Code Online (Sandbox Code Playgroud)
并执行以下操作:右键单击项目 - >属性 - > android - >选择大于8的目标
Com*_*are 26
http://developer.android.com/guide/practices/screens-distribution.html#FilteringHansetApps
...您可以使用该元素根据屏幕大小和密度的组合管理应用程序的分发.Google Play等外部服务使用此信息对您的应用程序应用过滤,因此只有具有您声明兼容性的屏幕配置的设备才能下载您的应用程序.
该<compatible-screens>页面中的示例元素:
<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>
Run Code Online (Sandbox Code Playgroud)
但是,我建议也增加密度的线xxhdpi,因为这样的设备现在出货(Droid DNA,Xperia Z,HTC Butterfly等).
UPDATE
首先,关于构建错误,如果您阅读了<compatible-screens>元素的文档,您会注意到它是在API级别9中添加的,并且由于某些奇怪的原因,您构建的目标设置为早于此.
第二,关于:
我需要我的应用程序在普通人称之为智能手机的设备上运行而不是普通人称之为平板电脑的设备上运行...例如它必须运行在"Galaxy Note 2"而不是"Galaxy Tab"上运行
这是不可能的,原因很简单,因为您没有具体定义您的操作以及不希望您的应用程序发货.
这个星球上有大约80亿"正常人".欢迎您采访他们中的每一个并询问他们对Galaxy Note 2的看法.有人会说电话.有人会说平板电脑.有些人会说"平板手枪",这将是无用的.有些人会把你赶出家门,声称你已经带了一些发光的恶魔进入他们中间(这也没用,如果他们有方便扔石头可能会很痛苦).
如果在将来的某个时间点,您想出了一个科学的定义,即您要做什么,不想发送您的设备,请提出一个新的StackOverflow问题.通过"科学定义",我的意思是一种算法,可以被所有设备上的所有人普遍应用,以确定您做什么和不想要您的应用程序.
(请注意,"所有人",我排除那些可能认为你是恶魔贩子的人)
例如:
"我想在所有具有电话功能的设备上发货,无论屏幕尺寸如何"
"我希望在屏幕尺寸小于这么多英寸的所有设备上运送:
在清单文件中使用支持屏幕标记是错误的方法.送花儿给人使用<compatible-screens>,使您的应用程序无法使用平板电脑.
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens="false"
android:resizeable="false" />
Run Code Online (Sandbox Code Playgroud)
警告
如果您将元素用于上述方案(当您的应用程序与较大屏幕不兼容时)并将较大的屏幕尺寸属性设置为"false",则Google Play等外部服务不会应用过滤.您的应用程序仍可用于更大的屏幕,但在运行时,它不会调整大小以适应屏幕.相反,系统将模拟手机屏幕大小(约320dp x 480dp;有关详细信息,请参阅屏幕兼容模式).如果您想阻止您的应用程序在较大的屏幕上下载,请按照@CommonsWare的建议使用.
使用标记排除您的应用在平板电脑上运行.
<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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12437 次 |
| 最近记录: |