In ym android app, I have Settings menu in which use sets their app mode, sound, music …etc
I retreive/store this in from/in shared preferences.
My question is onceI retreive this info, where is the best place to store it to make accessible by my whole application?
So far what I do is I read it from my mian activityu and sent it as an Extra between activities but something is telling me it is not efficient/correct way. Should I store the info in the Application class so any activity can access it while the app is running
Thank you
Why not just grab it from SharedPreferences every time you want the value? This saves you from having two copies of the same data in the application which could potentially get out of sync.
I’m assuming you don’t need to poll these values thousands of time per second such that it would have any kind of meaningful performance impact.
Further reading:
Don’t Repeat Yourself – Wikipedia