How to determine the screen resolution and device density for installing the same user interface display on the emulator and device?

I need to install the same interface on both the device and the emulator (in my application, the user interface in the emulator and the device changes), for which I need to know the screen resolution and device density. I don’t know how to find out. Let me know how to find out on the device.

Thanks,

Lakshmanan

+4
source share
1 answer
DisplayMetrics displaymetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); int screenHeight = displaymetrics.heightPixels; int screenWidth = displaymetrics.widthPixels; 
+9
source

All Articles