In android,Google recommends us to save the global variables in Application. But there is a problem, if the android os kill the application because of low of memory, the app
As per new guidelines always Consider using apply() instead of commit on shared preferences. Whereas commit blocks and writes its data to persistent storage immediately, apply will handle it in the background and will not hamper your other ongoing work.