Method to get string from preference
string value of desired preference
preference's name
preference's default value when the value is null