When my app starts, I populate a container class with values from my shard prefs. The idea was to handle the SharedPreferences and PreferenceManager once since I'm guessing they're heavy.
Here's a sample:
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(cont);
StorageClass.lifespan = Integer.parseInt( prefs.getString("lifespan", "8") );
StorageClass.hiRate = Integer.parseInt( prefs.getString("hiRate", "71") );
//and on and on for all preferences
Other activities then request these values.
But as my app grows, main memory is becoming tight.
Would it be better to have every requester make an instance of SharedPreferences and get the value they want?
Thanks