Check out example codes for "get preference value android". It will help you in understanding the concepts better.

Code Example 1

boolean mBoolean = PreferenceManager.getDefaultSharedPreferences(yourContext).getBoolean(key, defaultValue); //getBoolean will return defaultValue is key isn't found
//you can also use getInt, getFloat, getLong, getString, getStringSet and change the variable type, of course

Learn ReactJs, React Native from akashmittal.com