Android examples for User Interface:Screen Size
This Function return the Android Device Display Width.
//package com.java2s; import android.app.Activity; import android.content.Context; public class Main { /**/*from w w w .j av a 2s .c o m*/ * This Function return the Android Device Display Width. * * See below for @params. */ public static int getMyDispalyWidth(Context ctx) { int Width = ((Activity) ctx).getWindowManager().getDefaultDisplay() .getWidth(); return Width; } }