标签:android blog http ar art sp log c ef
摘选自 http://blog.csdn.net/chenguang79/article/details/9222817
DisplayMetrics dm = new DisplayMetrics();
dm = getResources().getDisplayMetrics();
float density = dm.density; // 屏幕密度(像素比例:0.75/1.0/1.5/2.0)
int densityDPI = dm.densityDpi; // 屏幕密度(每寸像素:120/160/240/320)
float xdpi = dm.xdpi;
float ydpi = dm.ydpi;
int screenWidth = dm.widthPixels; // 屏幕宽(像素,如:480px)
int screenHeight = dm.heightPixels; // 屏幕高(像素,如:800px)
个人学习记录,可参考
标签:android blog http ar art sp log c ef
原文地址:http://www.cnblogs.com/dengqz/p/3979370.html