Tag Archives: screen

1,213 views

Screen size density independent pixel resolution

Terms Screen size, density, density independent pixel, resolution as a picture – pictogram. Test your knowledge Q: How to find out the phone screen size? A: (By length of display diagonale in inch –  Not to measure a diagonal of device!!!) Q: … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Screen size density independent pixel resolution
2,488 views

Get Set Screen Orientation Android Code

// in AndroidManifest.xml <Activity android:screenOrientation="portrait" // or landscape   // in MyActivity.java boolean mbOrientacionLandscape = false; int nOrientation = getResources().getConfiguration().orientation; if(mbOrientacionLandscape==true){ getResources().getConfiguration(); if(nOrientation != Configuration.ORIENTATION_LANDSCAPE) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);   } else{ if(nOrientation != Configuration.ORIENTATION_PORTRAIT) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }

Posted in Android Examples Code | Tagged | Comments Off on Get Set Screen Orientation Android Code
4,163 views

Change Screen Orientation Programmatically Android

Landscape – portrait orientation change: boolean mbOrientationLandscape = true; if(mbOrientationLandscape ){ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); mbOrientationLandscape =false; }else{ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); mbOrientationLandscape =true; }

Posted in Android Examples Code | Tagged | Comments Off on Change Screen Orientation Programmatically Android
2,255 views

Create Image From View Screen Android

WebView_webview = (WebView)findViewById(R.id.webViewMapa); _webview.getSettings().setBuiltInZoomControls(true); _webview.setBackgroundColor(Color.parseColor("#E8EAE8")); // _webview.loadUrl( … some your page   Bitmap b = Bitmap.createBitmap(_webview.getWidth()/2, _webview.getHeight(), Bitmap.Config.ARGB_8888); // you can to draw on bitmap Canvas c = new Canvas(b); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStrokeWidth(15.f); paint.setColor(Color.RED); paint.setStyle(Paint.Style.STROKE); //paint.setShadowLayer(5.f, 0, … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Create Image From View Screen Android
1,980 views

How to add or remove widgets home screen android 4

Video tutorial How to add or remove widgets home screen Android 4.

Posted in Smartphone | Tagged | Comments Off on How to add or remove widgets home screen android 4
2,248 views

How to Add Home Screen Widgets on Your Android Phone

Long press by finger on screen From dialogue select Widgets Select your widget Put your widget on the screen Video tutorial – to add home screen widgets – Android 2.1

Posted in Smartphone | Tagged | Comments Off on How to Add Home Screen Widgets on Your Android Phone
3,033 views

Full Screen No title Android

Full Screen without titlebar and statusbar for Android Activity. In Activity.java public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } or in AndroidManifest.xml <activity android:name=".ActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> </activity>

Posted in Android Examples Code | Tagged | Comments Off on Full Screen No title Android
7,015 views

Get Screen Size Pixels per Inch Android example

The exact physical pixels per inch of the screen Get size of pixel Get DPI Get count of pixels per inch float mXDpi; float mYDpi; DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); mXDpi = metrics.xdpi; // The exact physical pixels per … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on Get Screen Size Pixels per Inch Android example
9,889 views

Force Screen On – dont use WakeLock – use getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) – Android sample

FLAG_KEEP_SCREEN_ON saving energy. Protects the battery if a user closing applications using the Return button on device. The device will returned to user screen mode settings. @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); //………. getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }

Posted in Android Examples Code | Tagged , , | Comments Off on Force Screen On – dont use WakeLock – use getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) – Android sample
2,070 views

Screen Android Landscape Portrait programmatically

Screen Android example source code for developers. Get orientation of screen. public int getScreenOrientation() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { return 1; // Portrait Mode   }else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { return 2; // Landscape mode } return 0; … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Screen Android Landscape Portrait programmatically