Android — Application Class vs. SharedPreferences

Share your data globally. Which one to use?

I’ve update my apps to include OneSignal Push Notif. Came across its documentation here:

Why the init is extending Application class?

This article also, explained why we should.

Okay, so what’s the difference with SharedPreferences?

After researching, I found a useful answer here:

There’s no right answer really, use it to suit your needs :D but thanks for visiting!

OneSignal is relatively simple to configure. You might want to check its documentation here

Also, you might wanna check my previous article on how to maintain your data state when NavigationUp cycles here

Happy coding, guys!!!

Like what you read? Give Mochamad Iqbal Dwi Cahyo a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.