Code example for DisplayMetrics

Methods: getMetrics

0
		mMap.put(context, this);
		 
		mContext = context;
				 
		if(PIXEL_DENSITY == 0.0f) {
			DisplayMetrics metrics = new DisplayMetrics();
			((Activity)mContext).getWindowManager().getDefaultDisplay().getMetrics(metrics);
			PIXEL_DENSITY = metrics.density;
			PIXEL_DENSITY_DPI = metrics.densityDpi;
		} 
		 
		/* 
		 *  Adaptive ResPatch by Petar Segina <psegina@ymail.com> 
		 *  By default, Gallery3D is made to load very low resolution images in 
		 *  order to avoid running into outOfMemory situations. Since some devices come with enormous 
		 *  amounts of memory and processing power, it is pointless not to use those resources. So,  
		 *  depending on the maximum heap size available, we want to determine the highest 
		 *  possible upscale factor. This is calculated from the heap size and then used in 
		 *  com.cooliris.media.Utils.java to return higher resolution images. 
		 */ 
		if(RESPATCH_FACTOR == 0){