On Android, you can either check the screen resolution through the device settings or check it programmatically (using Java or Kotlin, or another programming language compatible with Android).
Check Screen Resolution through Settings
The most user-friendly way to check the resolution is by navigating to the Settings app on your Android device.
- Open the Settings app on your Android device. The icon looks like a gear or a set of sliders.
- Depending on your device, you might find the display settings under Display, Screen or Device settings.
- Look for an option that provides information about the screen resolution. It might be labeled as Resolution, Screen resolution or something similar.
Another method is to check the About Phone menu:
- Open the Settings app on your Android device. The icon looks like a gear or a set of sliders.
- Scroll down to the System section and tap it.
- Look for the About phone option and tap it.
- Next, scroll down the page and look for an item called Screen Resolution.
Check Screen Resolution with ADB
ADB is an utility that you can use to connect to your Android device, through CLI.
Simply connect your device with a USB cable and make sure that USB debugging is active.
Next, you can use the shell to fetch information about the current window.
Look for information in the output that starts with mDisplayInfo, you will see the resolution (width and height) in pixels in the result.
Check Screen Resolution Programmatically
You can use this example code, written in Java, to check the screen resolution of the device.
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
public class ScreenUtils {
public static String getScreenResolution(Context context) {
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
if (windowManager != null) {
Display display = windowManager.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
int widthPixels = metrics.widthPixels;
int heightPixels = metrics.heightPixels;
return widthPixels + " x " + heightPixels;
} else {
return "Unknown";
}
}
}
Using this class, you can then fetch the resolution anywhere in your Android app: