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