get Display Density - Android User Interface

Android examples for User Interface:Display

Description

get Display Density

Demo Code


//package com.java2s;

import android.content.Context;

public class Main {
    private static Context context;

    public static float getDisplayDensity() {
        return context.getResources().getDisplayMetrics().density;
    }/* w w  w. j  ava2s .  c  o m*/
}

Related Tutorials