设计的Andr​​oid平板电脑,唯一的应用程序 [英] Designing an android tablet-only app

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

问题描述

让我们说,我想建立2套不同的平板电脑只布局。 一个用于600dp(7平板电脑1024×600),一个用于720dp(10平板电脑1280×720或1280×800)

Let's say that I want to build 2 different sets of tablet-only layouts. One for 600dp (7" tablet 1024x600) and one for 720dp (10" tablet 1280x720 or 1280x800)

据我所知,与Android 3.2,你现在可以指定平板电脑的布局。我明白,但如何指定在谷歌播放,这是一个平板电脑专用应用程序。

I understand that with android 3.2 you can now specify the tablet layouts. I understand that but how to specify on Google Play that this is a tablet-only app.

有这样的android:requiresSmallestWidthDp指定最小smallestWidth必需的。不错,但后来的指南,你可以阅读

There is this android:requiresSmallestWidthDp to specify the minimum smallestWidth required. Fine but later on the guide you can read

注意:Android系统并没有注意这个属性,因此它不会影响您的应用程序的行为在运行时。相反,它是用来使过滤您上的服务,如谷歌播放应用程序。然而,谷歌播放目前不支持此属性过滤(在Android 3.2),因此您应该继续使用其他大小的属性,如果你的应用程序不支持小屏幕。

Caution: The Android system does not pay attention to this attribute, so it does not affect how your application behaves at runtime. Instead, it is used to enable filtering for your application on services such as Google Play. However, Google Play currently does not support this attribute for filtering (on Android 3.2), so you should continue using the other size attributes if your application does not support small screens.

所以,它不使用的系统,而不是使用谷歌玩......所以基本上是没有用的,对吧?

So it's not used by the system and not used by Google Play...so basically it's useless ,right ?

你应该继续使用其他大小的属性,如果你的应用程序不支持小屏幕。

"You should continue using the other size attributes if your application does not support small screens.

确定。还有什么其他大小属性? 支撑屏吗? XLARGE:屏幕是至少960dp x 720dp 大:屏幕是至少640dp x 480dp

Ok. What other size attribute? The supports-screens one ? Xlarge : screens are at least 960dp x 720dp large : screens are at least 640dp x 480dp

在1024x600的7平板电脑是一个大屏幕。 所以我基本上要设计布局为640×480水库。也因为如果我想我的应用程序可用于2个不同大小的药片,我要启用大和XLARGE屏幕。

The 1024x600 7" tablet is a "large" screen. So I basically have to design a layout for the 640x480 res. too because if I want my app to be available for the 2 different sizes of tablets, I have to enable large and xlarge screens.

所以我想,我可以建立2套不同的布局,像这​​样

So I guess that I could build 2 different sets of layouts like this

res/layout-sw600dp/main_activity.xml   # For 7" tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10" tablets (720dp wide and bigger)

和完全忽略指定较小的屏幕布局,但随后该应用程序会崩溃在一个较小的屏幕。这是一种方法,prevent应用程序从运行肯定是不优雅。

and completely omit to specify a layout for smaller screens but then the app would crash on a smaller screen. That's a way to prevent the app from running that sure is not elegant.

有没有一种方法,使只对谷歌,播放的600dp和更大的屏幕可用的应用程序? 我很困惑。 我想打一个平板电脑专用应用程序,640×480的手机无法在谷歌,播放下载。 我想我失去了一些东西很明显的。

Is there a way to make the app available only for the 600dp and greater screens on Google-Play? I'm quite confused. I want to make a tablet-only app that a 640x480 phone could not download on Google-Play. I guess I'm missing something very obvious.

推荐答案

为了让您的应用程序过滤,只是 在谷歌,玩运行ICS平板电脑 你会在你的Andr​​oidManifest做到这一点:

To get your app filtered for just Tablets running ICS in Google-Play you would do this in your AndroidManifest:

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

 <uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="14" />

要获得蜂窝片藏汉你只要改变你的minSdk

To get HoneyComb Tablets aswell you simply change your minSdk

 <uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="14" />

所以你说现在的姜饼(2.3)及以下不能下载你的应用程序(因为他们不是片中的也设计在平板电脑上工作,即使它被砍死在)。

蜂窝片(3.0)支持(因为&LT; 3.2是忽略了requiresSmallestWidth属性)

HoneyComb Tablets (3.0) is supported (because <3.2 is ignoring the requiresSmallestWidth attribute)

没有电话运行蜂窝

ICS平板电脑都支持,因为它不看你的smallestWidth属性

ICS Tablets are supported because it does look at your smallestWidth attribute

终于ICS手机都没有,因为像我们说的ICS使用smallestWidth属性

and finally ICS phones aren't because as we say ICS uses the smallestWidth attribute

这篇关于设计的Andr​​oid平板电脑,唯一的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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