Hi,
Revisiting some Google and Firebase stuff Summers and I realized the
Firebase Android SDK doesn’t need we do any init to the lib starts/be
configured.
TL;DR what Firebase does is uses a Content Provide[1] (not really created
for this) as a trick to initialize the lib before the app starts
Why Content provider?
Because it has access to the applicationContext[2] and is called *before*
all other Android kinds of stuff in the Android lifecycle (including
Application)
I’d like to do the same for our Android SDK and initialize the lib using
the same trick so we can provide a MobileCore.getInstance() already
configured with all the things the developer needs (Logger, HttpLayer,
Mobile Services info, etc…) without need to create an application class or
call MobileCore.init(context) anywhere and kill all static methods we have
today in MobileCore
It will also allow us to send the default metrics before the Android
lifecycle starts the app and have some controls (when need) to know when
the app is in background and foreground, listeners possible crashes and
other things without the developer needs to call/configure anything.
PS: This is will probably be the first step to kill the responsibility to
the MobileCore instantiate the Service Modules[3]
Any thoughts?
[1]
https://developer.android.com/guide/topics/providers/content-providers.html
[2]
https://developer.android.com/reference/android/content/ContentProvider.h...
)
[3]
https://issues.jboss.org/browse/AGDROID-796
--
-- Passos