从Android应用程序识别的GoogleTV [英] Identify GoogleTv from Android app

查看:141
本文介绍了从Android应用程序识别的GoogleTV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为一个Android应用程序,告诉在Java code如果在GoogleTV的运行VS平板电脑或手机?

Is there a way for an Android app to tell in the Java code if it is running on GoogleTV vs tablets or phones?

推荐答案

下面这个链接可以帮助你:的谷歌电视的Andr​​oid开发者指南以优化您的应用程序的谷歌电视,只需添加一个额外的layour的大屏幕。但是,如果您要确定当前正在使用在运行应用程序的设备,您可以尝试的<一个href="http://developer.android.com/reference/android/content/pm/PackageManager.html#hasSystemFeature%28java.lang.String%29">hasSystemFeature()方法。有了这个,你可以测试某些硬件功能所特有的谷歌电视(例如,你可以测试FEATURE_TOUCHSCREEN,因为任何设备,但谷歌电视有一个实施=>如果不支持该功能,应用程序可能是在电视上运行)。

The following link might help you: Google TV Android Developer's Guide To optimize your app for a Google TV, just add an additional layour for large screens. However, if you want to determine the device that is currently using the app at runtime, you could try the hasSystemFeature() method. With this you can test for certain hardware features that are unique to Google TV (e.g. you could test for FEATURE_TOUCHSCREEN, as any device but Google TV has one <=> if the feature is not supported, the app is probably running on a TV).

这篇关于从Android应用程序识别的GoogleTV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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