问题描述
我想端口我的应用程序的智能手机与稍作修改的平板电脑开发。有没有在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的Android 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 ;)
这篇关于如何检测的Android平板设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!