如何检测的Andr​​oid平板设备? [英] How to detect a tablet device in Android?

查看:99
本文介绍了如何检测的Andr​​oid平板设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想端口我的应用程序的智能手机与稍作修改的平板电脑开发。有没有在Android的API来检测,如果该设备是平板电脑?

I am trying to port my application developed for smartphones to the tablets with minor modifications. Is there an API in Android to detect if the device is tablet?

我可以通过比较屏幕尺寸做到这一点,但什么是检测平板正确的方法?

I can do it by comparing the screen sizes, but what is the correct approach to detect a tablet?

推荐答案

我会推出平板模式应用程序设置,这将被默认启用的,如果分辨率(使用总像素的阈值),表明它。

I would introduce "Tablet mode" in application settings which would be enabled by default if resolution (use total pixel threshold) suggests it.

IFAIK的Andr​​oid 3.0引入了真正的平板电脑的支持,所有的previous版本适用于手机和平板电脑只是更大的手机 - 得到了一个;)

IFAIK Android 3.0 introduces real tablet support, all previous versions are intended for phones and tablets are just bigger phones - got one ;)

这篇关于如何检测的Andr​​oid平板设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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