Re: [android-developers] Finding display width in dp

2012-06-29 Thread Aashish kumar
it will help u dear Display display = getWindowManager().getDefaultDisplay(); int screenWidth = display.getWidth(); int screenHeight = display.getHeight(); float dips_120 = 120.0f; float scale = view.this.getResources().getDisplayMetrics().density;

[android-developers] Finding display width in dp

2012-06-22 Thread Raghav Sood
Hi, Does android have any method that returns the display width in dp? DisplayMetrics only seems to return the scale factor and exact pixels as far as I could tell from the docs, or did I miss something? If not, is there an exact formula I could use to calculate the display width in dp? Thanks

Re: [android-developers] Finding display width in dp

2012-06-22 Thread Justin Anderson
http://developer.android.com/guide/practices/screens_support.html#dips-pels Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Fri, Jun 22, 2012 at 9:11 AM, Raghav Sood raghavs...@gmail.com wrote: Hi, Does android have any method that returns the