Code example for Thread

Methods: getHeightgetRefreshRategetWidthsleep

0
		return scoreTotal;
	} 
	 
	private void sleepMs(Integer time) {
		try { 
			Thread.sleep(time);
		} catch (InterruptedException e) {
 
		} 
	} 
	 
	private void getMaxCPU() { 
		try { 
			scoreCPUhz = HardwareInformation.getCPUFrequencyMax();
			Log.d(TAG, "" + scoreCPUhz);
			publishProgress("Looking for Max CPU Hz:", "CPU: " 
					+ scoreCPUhz / 1000 + " MHz");
			 
		} catch (Exception e1) {
			scoreCPUhz = 0;
			publishProgress("Looking for Max CPU Hz:", 
					"Failed"); 
			Log.d(TAG, e1.getMessage());
		} 
	} 
 
	private void getMaxCPUFrequency()  
	{ 
		try { 
			scoreCPUscaling = HardwareInformation.getCPUFrequencyMaxScaling(); 
			publishProgress("Looking for Max CPU scaling", "CPU Scaling: " 
					+ scoreCPUscaling);
			Log.d(TAG, "" + scoreCPUscaling);
		} catch (Exception e1) {
			scoreCPUscaling = 0;
			publishProgress("Looking for Max CPU scaling:", 
					"Failed"); 
			Log.d(TAG, e1.getMessage());
		} 
	} 
 
	private void getMaxBogoMips()  
	{ 
		try { 
			scoreCPUBogoMips = (int)HardwareInformation.getCPUBogoMips();
			publishProgress("Looking for CPU BogoMips:", "CPU BogoMips: " 
					+ scoreCPUBogoMips);
			Log.d(TAG, "" + scoreCPUBogoMips);
		} catch (Exception e1) {
			scoreCPUBogoMips = 0;
			publishProgress("Looking for CPU BogoMips:", 
					"Failed"); 
			Log.d(TAG, e1.getMessage());
		} 
	} 
 
	private void getScreenResolutionRefreshRate() 
	{ 
		WindowManager windowManager = activity.getWindowManager();
		Display display = windowManager.getDefaultDisplay();
		int width = display.getWidth();
		int height = display.getHeight();
		scoreResolution = width + height;
		publishProgress("Looking for Screenresolution:", "Screen Resolution: " 
				+ width + "x" + height);
		Log.d(TAG, "" + width + " " + height); //Pixels
 
		sleepMs(100); 
 
		publishProgress("Looking for Refresh rate:", "Screen Refreshrate : " 
				+ display.getRefreshRate() + " Hz");
		Log.d(TAG, "refreshrate: " + display.getRefreshRate());
	} 
 
	private void getScreenDPI()  
	{ 
		DisplayMetrics dm = new DisplayMetrics();
Stop searching for code, let great code find you!  Add Codota to your java IDE