Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if an Android device has a screen i.e. whether it is an Android set top box?

I know one can obtain screen sizes, but I would like to know if someone has ever been able to find out if the Android device has a screen or not. i.e. whether it is a set top box or not.

I guess screen size returned should be "zero", but I am not sure if that is actually the response in the real world.

Thank you.

like image 784
Carlos F Avatar asked Apr 24 '15 05:04

Carlos F


People also ask

How do I detect the device is an Android phone/tablet?

This example demonstrates how do I detect the device is an Android phone or Android tablet. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.java. ...

How do I know what version of Android I have?

Open Settings and go to either ‘System’, or ‘About Phone’. The name will differ based on your device but you’re looking for information about your phone. Check the Kernel version here. If it’s not on this screen, look for the Android version, and tap it.

How to check whether a headset is plugged into an Android device?

This example demonstrates how do I check whether a headset is plugged into an android device. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.java

How do I Find my System Settings on my Android phone?

It’s almost always a button at the bottom of your home screen, in the center. Scroll through the list of installed apps and look for an app named “Settings”. Tap the Settings icon to enter Android’s system-wide Settings app. Scroll down on the Settings screen and look for an “About phone”, “About tablet”, or “System” option.


1 Answers

You can check for a TV device.

public static final String TAG = "DeviceTypeRuntimeCheck";

UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
    Log.d(TAG, "Running on a TV Device");
} else {
    Log.d(TAG, "Running on a non-TV Device");
}
like image 89
Alex Baker Avatar answered Oct 22 '22 19:10

Alex Baker