ulfben icon

Android get screen density name (bucket)

ulfben | PRO | 01/25/17 07:24:19 PM UTC | 0 ⭐ | 1219 👁️ | Never ⏰ | []
Java |

580 B

|

None

|

0 👍

/

0 👎

//https://developer.android.com/about/dashboards/index.html#Screens
private static String getDensityName(DisplayMetrics dm) {
        float density = dm.density;
        if (density >= 4.0) {
            return "xxxhigh density";
        }
        if (density >= 3.0) {
            return "xxhigh density";
        }
        if (density >= 2.0) {
            return "xhigh density";
        }
        if (density >= 1.5) {
            return "high density";
        }
        if (density >= 1.0) {
            return "medium density";
        }
        return "low density";
    }

Comments

  • Rteuixl icon
    04/02/26 04:52:04 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎