code: public static boolean validateResource(String uriString) {
          if(uriString == null) {
              return false;
          }
  
          try {
              return validateResource(createUri(uriString));
          } catch(DataSourceException e) {
              Log.d(TAG, "URI is not valid", e);
              return false;
          }
      }
docs: Convert the parameter to a URI and validate the correctness of its host
  and port.
  
  @return true if the address and port are valid.