VWOUtils { public static double getScale(Context context) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); return 1.0f / DisplayMetrics.DENSITY_DEFAULT * displayMetrics.densityDpi; }  static boolean isValidVwoAppKey(String appKey); static String getDeviceUUID(VWOPreference vwoPreference); static String androidVersion(); static boolean isTablet(@NonNull Context context); static int applicationVersion(Context context); static double getRandomNumber(); static boolean checkForInternetPermissions(Context context); static Calendar getCalendar(); static boolean checkIfClassExists(String className); static String getDeviceName(); static boolean isApplicationDebuggable(@NonNull Context context); static int getScreenWidth(); static int getScreenHeight(); static double getScale(Context context); static String getDeviceCountryCode(Context context); @Nullable static String toMD5Hash(String message);  }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-ldpi") public void scaleLdpiTest() { Assert.assertEquals(0.75, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-mdpi") public void scaleMdpiTest() { Assert.assertEquals(1.0, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-hdpi") public void scaleHdpiTest() { Assert.assertEquals(1.5, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-xhdpi") public void scaleXhdpiTest() { Assert.assertEquals(2.0, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-xxhdpi") public void scaleXxhdpiTest() { Assert.assertEquals(3.0, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }
@Test @Config(qualifiers = "en-rUS-w240dp-h320dp-xxxhdpi") public void scaleXxxhdpiTest() { Assert.assertEquals(4.0, VWOUtils.getScale(RuntimeEnvironment.application.getApplicationContext())); }