Identify GoogleTv from Android app

后端 未结 4 1580
不知归路
不知归路 2020-12-17 20:54

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

4条回答
  •  一个人的身影
    2020-12-17 21:34

    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).

提交回复
热议问题