Android examples for Graphics:Pixel
get Display Center Pixel
//package com.java2s; import android.content.Context; import android.graphics.Point; import android.view.Display; import android.view.WindowManager; public class Main { public static int getDisplayCenterPixel(Context context) { WindowManager wm = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size);// w w w . ja v a 2s . com return size.y / 2; } }