From the basic method that includes in the Shared preferences there is not specific method for double (setter and getter), but for Float. The problem is in Java, float has 32 bits and double 64, which if we set and get the double as float, there could be problem of precision.
In order to save double correctly in the shared preferences, it must be saved as long, which also has 64 bits.
To do so, double must be converted (not casted) to Long.
- Double to Long:
- Long to Double
: The Java tutorials - Primitive Data Types
: StackOverflow - Cant put double SharedPreferences