1. Download our Official Android App: Forums for Android!

Apps Density issue

Discussion in 'Android Development' started by kaliki, Mar 22, 2010.

  1. kaliki

    kaliki Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    11
    Joined:
    Jan 21, 2010

    Jan 21, 2010
    11
    0
    15
    Does anyone know how to get/calculate display density on android 1.5.
    I created my app using displaymetrics.densityDpi and it works fine on 1.6+
    but now i need to make it compatible with 1.5...any ideas ?
    Tnx
     

    Advertisement

  2. loick

    loick Well-Known Member
    Rank:
    None
    Points:
    36
    Posts:
    154
    Joined:
    Jun 25, 2009

    Jun 25, 2009
    154
    5
    36
    Paris
    I used this formula but it's approximative to convert dpi to pix using 1.1 framework.

    40pix = ((40 *getResources().getDisplayMetrics().density) + 0.5f);

    Hope this will help
     

Share This Page

Loading...