I’m using SharedPreferences to save two kinds of preference information.
1) General app preferences like results per page, sessionTime, etc. which are accessible only once you’re logged in.
2) A session identifier like the users name and surname. One can see the name on every activity/page so as to know the the session is ok.
Is it ok for me to use sharedPreferences with 2 separate string identifiers. One for general settings and another for session info and manage the usage of these setting through my global application class or is my approach totally wrong?
By design Android does not differ between application/user preferences. Don’t bother creating 2 different preference files, just use
PreferenceManager.getDefaultSharedPreferences(yourContext)everywhere