Java tutorial
//package com.java2s; import android.content.Context; import android.view.Display; import android.view.WindowManager; public class Main { public static int getWidthScreen(Context context) { Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); return display.getWidth(); } }