Check out example codes for "preferencemanager is deprecated". It will help you in understanding the concepts better.

Code Example 1

//You can use AndroidX support library version of PreferenceManager
androidx.preference.PreferenceManager
//not 
android.preference.PreferenceManager
//remember to add the following to your build.gradle if needed
implementation 'androidx.preference:preference:1.1.1'

Learn ReactJs, React Native from akashmittal.com