Code example for Display

Methods: getMetricsgetOrientation, toString

0
         
        // リストを構成 
        WindowManager windowManager = getWindowManager();
        Display display = windowManager.getDefaultDisplay();
        DisplayMetrics displayMetrics = new DisplayMetrics();
        display.getMetrics(displayMetrics);
        Configuration configuration = getResources().getConfiguration();
         
        List<String> list = new ArrayList<String>();
        list.add("Build.BOARD = " + android.os.Build.BOARD);
        list.add("Build.BOOTLOADER = " + android.os.Build.BOOTLOADER);
        list.add("Build.BRAND = " + android.os.Build.BRAND);
        list.add("Build.CPU_ABI = " + android.os.Build.CPU_ABI);
        list.add("Build.CPU_ABI2 = " + android.os.Build.CPU_ABI2);
        list.add("Build.DEVICE = " + android.os.Build.DEVICE);
        list.add("Build.DISPLAY = " + android.os.Build.DISPLAY);
        list.add("Build.FINGERPRINT = " + android.os.Build.FINGERPRINT);
        list.add("Build.HARDWARE = " + android.os.Build.HARDWARE);
        list.add("Build.HOST = " + android.os.Build.HOST);
        list.add("Build.ID = " + android.os.Build.ID);
        list.add("Build.MANUFACTURER = " + android.os.Build.MANUFACTURER);
        list.add("Build.MODEL = " + android.os.Build.MODEL);
        list.add("Build.PRODUCT = " + android.os.Build.PRODUCT);
        list.add("Build.RADIO = " + android.os.Build.RADIO);
        list.add("Build.SERIAL = " + android.os.Build.SERIAL);
        list.add("Build.TAGS = " + android.os.Build.TAGS);
        list.add("Build.TIME = " + android.os.Build.TIME);
        list.add("Build.TYPE = " + android.os.Build.TYPE);
        list.add("Build.UNKNOWN = " + android.os.Build.UNKNOWN);
        list.add("Build.USER = " + android.os.Build.USER);
        list.add("Build.VERSION.CODENAME = " + android.os.Build.VERSION.CODENAME);
        list.add("Build.VERSION.INCREMENTAL = " + android.os.Build.VERSION.INCREMENTAL);
        list.add("Build.VERSION.RELEASE = " + android.os.Build.VERSION.RELEASE);
        list.add("Build.VERSION.SDK = " + android.os.Build.VERSION.SDK);
        list.add("Build.VERSION.SDK_INT = " + android.os.Build.VERSION.SDK_INT);
        list.add("DisplayMetrics.density = " + displayMetrics.density);
        list.add("DisplayMetrics.densityDpi = " + displayMetrics.densityDpi);
        list.add("DisplayMetrics.heightPixels = " + displayMetrics.heightPixels);
        list.add("DisplayMetrics.scaledDensity = " + displayMetrics.scaledDensity);
        list.add("DisplayMetrics.widthPixels = " + displayMetrics.widthPixels);
        list.add("DisplayMetrics.xdpi = " + displayMetrics.xdpi);
        list.add("DisplayMetrics.ydpi = " + displayMetrics.ydpi);
        list.add("DisplayMetrics.toString() = " + displayMetrics.toString());
        list.add("Display.getOrientation() = " + display.getOrientation());
        list.add("Display.toString() = " + display.toString());
        list.add("Configuration.fontScale = " + configuration.fontScale);
        switch (configuration.hardKeyboardHidden) {
        case Configuration.HARDKEYBOARDHIDDEN_UNDEFINED:
            list.add("Configuration.hardKeyboardHidden = HARDKEYBOARDHIDDEN_UNDEFINED");
            break;