相关疑难解决方法(0)

设计一个Android平板电脑专用应用程序

假设我想构建2组不同的平板电脑布局.一个600dp(7"平板电脑1024x600)和一个720dp(10"平板电脑1280x720或1280x800)

据我所知,使用android 3.2,您现在可以指定平板电脑布局.我理解但是如何在Google Play上指定这是一款仅限平板电脑的应用.

有这个android:requiresSmallestWidthDp来指定所需的最小tinyWidth.很好,但后来你可以阅读指南

注意:Android系统不关注此属性,因此它不会影响应用程序在运行时的行为方式.相反,它用于为您的应用程序启用Google Play等服务的过滤功能.但是,Google Play目前不支持此属性进行过滤(在Android 3.2上),因此如果您的应用程序不支持小屏幕,则应继续使用其他大小属性.

所以它没有被系统使用而且没有被Google Play使用......所以基本上它没用,对吧?

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

好.还有什么尺寸属性?支持屏幕一个?Xlarge:屏幕至少为960dp x 720dp大:屏幕至少为640dp x 480dp

1024x600 7"平板电脑是一个"大"屏幕.所以我基本上必须为640x480 res设计一个布局,因为如果我想让我的应用程序可用于2种不同尺寸的平板电脑,我必须启用大型和xlarge屏幕.

所以我想我可以构建两组不同的布局

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)
Run Code Online (Sandbox Code Playgroud)

并完全省略为较小的屏幕指定布局,但随后应用程序将在较小的屏幕上崩溃.这是一种阻止应用程序运行的方法,确保不优雅.

有没有办法让应用程序仅适用于Google-Play上的600dp和更高屏幕?我很困惑.我想制作一款仅限平板电脑的应用,即640x480手机无法在Google Play上下载.我想我错过了一些非常明显的东西.

android android-layout google-play

31
推荐指数
1
解决办法
2万
查看次数

限制在平板电脑中安装应用

我有一个Android应用程序,我想停止在Tablet中安装此应用程序。我搜索了许多网站。我有一些想法,并遵循了。但这并不限制。

这是我访问过的一些站点。

Android清单仅限平板电脑

http://android-developers.blogspot.in/2011/09/preparing-for-handsets.html

我尝试将supports-screens应用程序安装在平板电脑中。这该怎么做?

注意:我的应用程序的minsdkversion = 8,targetsdkversion = 17

编辑1:我已经使用以下代码来查找屏幕大小

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

WindowManager wm=getWindowManager();
DisplayMetrics dm=new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
deviceWidth=dm.widthPixels;
deviceHeight=dm.heightPixels; 
if((deviceHeight< 640 && deviceWidth<480)|| (deviceHeight<480 && deviceWidth< 640))
  {
      //large screen - TABLET

  }
Run Code Online (Sandbox Code Playgroud)

但是我不知道where to put this code to restricts installation and …

android android-screen-support

5
推荐指数
1
解决办法
3251
查看次数