仅为平板电脑开发应用程序 [英] Develop application only for tablet

查看:185
本文介绍了仅为平板电脑开发应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管这个问题被问过很多次,但我找不到任何合适的解决方案.

Though this question is asked before many a times, I am not able to find any proper solution to it.

我只希望将我的应用程序安装在平板电脑上.我已经有相同的手机应用程序,现在我希望将其安装在平板电脑上.我的平板电脑用户界面与手机完全不同.

I just want my application to be installed on tablets. I already have the same application for phone and now I want it to be installed on tablets. My UI for tablet is totally different than phone.

Play商店现在添加了平板电脑精选应用程序"选项.我检查了

Play Store has now added a option of "Featured Apps for Tablets". I checked this

我是否应该通过添加<supports-screens android:requiresSmallestWidthDp="600">开发另一个仅适用于平板电脑的应用程序?

Should I develop another application featured for only tablet, by adding <supports-screens android:requiresSmallestWidthDp="600">?

但是我已经阅读了此处 Google Play没有使用标签requiresSmallestWidthDp进行过滤.

But I have read here ,that google play doesn't filter with the tag requiresSmallestWidthDp.

看到此电话正在从Android Play商店中选择平板电脑版本如果我使用Note2,Grand,Nexus-4之类的android:largeScreens="true"手机,则Nexus-4可以选择平板电脑的版本.但是我想让屏幕大于7英寸的屏幕安装我的应用程序.其他人不应在Play商店中显示安装按钮.

Seeing this Phones are picking tablet build from Android play store if i use android:largeScreens="true" phones like Note2, Grand, Nexus-4 could pick the tablet build. But I jst want screen > 7 inches should install my application. Other should not show install button in play store.

由于该选项似乎不起作用,那么我应该如何开始呢?我可以使用清单上的任何限制,以便该应用程序只能安装在平板电脑上吗?

As this option doesn't seem to be working, then how could I start with? Is there any restriction on manifest which I could use so that app would only be installed in tablets?

另一种解决方法是,我发现可以为手机和平板电脑制作一个通用应用程序. 并且在设备的屏幕尺寸上应用所有条件检查.根据屏幕尺寸,我可以区分平板电脑和手机的流程.

Another way around I found that to make a universal application for phone and tablet. And apply any condition checking on screen size of device. According to screen size I could differentiate the flow one for tablet and another for phone.

我完全困惑,应该最好走哪条路. 任何指导或暗示都会对我做出正确的决定大有帮助.

I am totally confused, which way should be best possible to go. Any guidance or hint would help me a lot in taking a proper decision.

推荐答案

最佳做法 部分:

如果您不希望您的应用程序在手机上使用(也许您的应用程序仅在大屏幕上才有意义),或者您需要时间针对较小的屏幕进行优化,则可以防止小屏幕设备下载您的应用程序通过使用 <supports-screens> 清单元素. /p>

If you don't want your app to be used on handsets (perhaps your app truly makes sense only on a large screen) or you need time to optimize it for smaller screens, you can prevent small-screen devices from downloading your app by using the <supports-screens> manifest element.

因此,您要做的就是确定您认为平板电脑开机并仅支持这些屏幕的屏幕尺寸.例如,正如开发人员所建议的.再次访问该网站,您可以将其限制为只有大屏幕和更大的¹,并在清单中使用<supports-screen>元素,例如这样(也从Android开发者网站借来):

So, what you'll want to do is decide what screen size you consider to be tablets-on-up and only support those screens. For example, as suggested by the dev. site again, you might limit it to only large screens and larger¹ with the <supports-screen> element in your manifest, like so (also borrowed from the Android dev site):

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

这不能保证您的应用程序无法在某些类别的超大型电话上运行(年轻人喜欢称呼它们为平板手机",但这只是试图基于任意性来限制它的本质)在Android开发中就像手机还是平板电脑一样,尤其是当真正的区别只是屏幕尺寸时.我还要提到,最好将平板电脑UI内置到您的应用中,但这可能会涉及一些额外的工作,具体取决于两个UI的不同.

This doesn't guarantee your app won't run on certain classes of very large phones ("phablets" as the youngsters like to call 'em), but that's just the nature of trying to limit it based on something as arbitrary in Android development as phone vs. tablet, especially when the real difference is just screen size. I could also mention that it's better to just build the tablet UI into your app, but that might involve some additional work depending on how different the two UIs are.

无论如何,您的主要问题将只是确定太小的尺寸并相应地对其进行限制. Google Play应该注意屏幕尺寸的下限,但是<supports-screens>元素中的上限在较大的屏幕上将被忽略,因为该应用将改为在兼容模式下运行.无论出于何种原因,为了防止屏幕变大,您都需要使用

At any rate, your main problem is just going to be to decide how small is too small and limit it accordingly. Google Play should respect lower bounds for the screen size, but upper bounds in the <supports-screens> element will be ignored on larger screens, as the app will be run in compatibility mode instead. To prevent larger screens, for whatever reason, you'll want to use <compatible-screens>, which you probably won't want to do unless your UI is completely inflexible for some reason.

¹这听起来很奇怪.

这篇关于仅为平板电脑开发应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆