defaultValue is what you get when there is no such key defined as "key" in shared pref, example if you are retrieving data for first time and you didn't write a value for your key it will return defaultValue.
double getDouble(final SharedPreferences prefs, final String key, final double defaultValue)
{ return Double.longBitsToDouble(prefs.getLong(key, Double.doubleToLongBits(defaultValue)));}
lets say you have put 542.3 into myDouble
getDouble("myDouble" , 5.0); // will return 542.3
but if you haven't put anything into myDouble
getDouble("myDouble" , 5.0); // will return 5
The common use, is when keep track of data, and your users can clear that data (imagine a highscore in a game) so you don't want to check if it exists, instead you launch it with default value.
getDouble("highscore" , 0.0); // will return highscore if exists otherwise will return 0