I have taken CSIPSIMPLE code and repackaged to com.mycompany.appname
The problem is, whenever app is crashed, All values are deleted from Shared preferences.
Why
This is common issue that many have faced including myself. Have a look at this post Android - Shared Preferences are lost sometimes which shares your findings.
I would recommend not storing persistent data across shared preferences and rather use something like a database table to store settings.