Function to get Int value from preference
Int from given key if exist, defaultValue if not
String key to refer
Int to return if the key doesn't return any value