code: public static boolean getResources_getBoolean(Context context, int id) {
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
              return context.getResources().getBoolean(id);
          }
  
          DisplayMetrics metrics = context.getResources().getDisplayMetrics();
          float widthDp = metrics.widthPixels / metrics.density;
          float heightDp = metrics.heightPixels / metrics.density;
          float smallestWidthDp = (widthDp < heightDp) ? widthDp : heightDp;
  
          if (id == R.bool.abs__action_bar_embed_tabs) {
              if (widthDp >= 480) {
                  return true; //values-w480dp
              }
              return false; //values
          }
          if (id == R.bool.abs__split_action_bar_is_narrow) {
              if (widthDp >= 480) {
                  return false; //values-w480dp
              }
              return true; //values
          }
          if (id == R.bool.abs__action_bar_expanded_action_views_exclusive) {
              if (smallestWidthDp >= 600) {
                  return false; //values-sw600dp
              }
              return true; //values
          }
          if (id == R.bool.abs__config_allowActionMenuItemTextWithIcon) {
              if (widthDp >= 480) {
                  return true; //values-w480dp
              }
              return false; //values
          }
  
          throw new IllegalArgumentException("Unknown boolean resource ID " + id);
      }
docs: Support implementation of {@code getResources().getBoolean()} that we
  can use to simulate filtering based on width and smallest width
  qualifiers on pre-3.2.
  
  @param context Context to load booleans from on 4.0+ and to fetch the
  display metrics.
  @param id Id of boolean to load.
  @return Associated boolean value as reflected by the current display
  metrics.