I'm trying decide which of the following is the proper way to do this:
- Calling
FirebaseAnalytics.getInstance(Context)
from every activity, fragment, and service that I'm logging an event from.
or
- Calling
FirebaseAnalytics.getInstance(Context)
once fromApplication
class and keeping it around as a public static variable. Then, from everywhere I need this I can call `MyAppClass.mFirebaseAnalytics.logEvent()'.
Will any of the above methods have a undesired impact on the events that are automatically collected and/or do either of those have an efficiency gain over the other?
Many thanks!
firebaseAnalytics.setCurrentScreen
where we can name the activity and stuff. So, my guess right now is that using application context is enough, but I haven't tested it yet.MyAppClass.mFirebaseAnalytics
when it is still null