ICS 上区分平板电脑和智能手机
据我所知,默认情况下(ICS 之前),要区分平板电脑和平板电脑。智能手机,开发者可以使用Android Manifest中的sdk版本(除了屏幕尺寸和openGL过滤器)。 现在,随着 ICS 在 SP 和平板电脑上运行,如果我需要区分 SP 和平板电脑,开发人员有哪些选择?
我认为屏幕尺寸不可靠。
可以说,由于某些原因,我无法为 SP 和平板电脑提供通用的 apk。 我还想避免单独申请平板电脑和 SP
I understand that by default (pre ICS), to distinguish between a Tablet & Smartphone, a developer can use the sdk version in the Android Manifest (apart from screen size and openGL filters).
Now with ICS running on both SP and Tablet, what options does a developer have in case I need to distinguish between SP and Tablet?
I don't think screen size is reliable.
Lets say for certain reasons I cannot have a common apk for SP and Tablet.
I would also like to avoid a separate application for Tablets and SP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般而言,平板电脑和手机之间唯一显着的区别是屏幕尺寸和电话功能,此外手机通常具有移动数据,而平板电脑可能仅支持 WiFi。对于ICS,在两类设备上运行的软件基本相同,因此唯一有趣的区别特征就是这些点。如果设备的屏幕足够大,可以容纳您的应用程序并提供所有所需的功能,那么它是手机还是平板电脑还有关系吗?
我想说屏幕尺寸正是你应该过滤的。与其说是“手机版”和“平板版”,不如说是“小屏”和“大屏”。
The only significant differences between tablets and phones are, in general, screen size and the presence of telephony capabilities, plus the fact that phones will generally have mobile data while tablets may be wifi-only. With ICS, the software running on the two classes of device is basically the same, so the only interesting distinguishing features are these points. If a device has a screen big enough for your app and provides all the required capabilities, does it matter if it's a phone or a tablet?
I'd say that screen size is exactly what you should be filtering on. It's not 'phone version' and 'tablet version' so much as 'little screen' and 'big screen'.
您还可以检查 build.prop
运行 ICS 的平板电脑应将此设置为平板电脑,手机将是phone/default
ro.build.characteristics=
You can also check build.prop
Tablets running ICS should have this set to tablet, phones would be phone/default
ro.build.characteristics=