code: public int getInt(String key){
          try {
              return Integer.parseInt(resource.getString(key));
          } catch (NumberFormatException e) {
              return -1; // modify here if you need to throw a Exception here
          }
      }
docs: /*
  Gets the int.
  
  @param key the key
  
  @return the int