Java tutorial
//package com.java2s; import android.content.Context; import android.view.WindowManager; public class Main { private static WindowManager windowManager; public static float getScreenWeigh(Context context) { windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); return windowManager.getDefaultDisplay().getWidth(); } }