i have created an android app where an object called ConnectionObject is created after a user successfully logged in. The ConnectionObject starts an timer which pulled every 10 seconds new events from a server.
So my question is, what is the best practice to store these ConnectionObject? Many activities, fragments and recylcerViewAdapter should have access to the same ConnectionObject. And what is the best way to recreate these object after the app is killed by the os in background? The user must be reloggedin and the ConnectionObject must be recreated before any other class accesses it.
It would be awesome if any one have some ideas or hints i have to looking for.
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire