百度地图API学习之路(3)
时间:2014-06-28 06:41:25
收藏:0
阅读:285
(1)SDK提供的缩放比例,大概是指每厘米长度在实际中的距离。
(2)获取设备的物理尺寸
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
double x = Math.pow(dm.widthPixels/dm.xdpi,2);
double y = Math.pow(dm.heightPixels/dm.ydpi,2);
double screenInches = Math.sqrt(x+y);
Log.d("debug","Screen inches : " + screenInches);(3)dpi是每英寸像素点数
评论(0)