-2

I wanted to know what are the best practices you guys follow while integrating let's say 30+ third party SDK's in your app. Also each SDK have a different version for debug and release mode. So how do you keep your code clean and readable and at the same time make sure all the SDKs are initialized correctly.

Cases:

  1. Should we initialize all the SDKs in MainApplication.kt which is extending the Application class
  2. Should we initialize all the SDKs in MainActivity.kt which is the single activity holding all the fragments.
  3. Should we initialize them on Splash Activity which gets finished after few seconds.
  4. Or any other approaches ?
  5. Also how do you maintain cleanliness in code for different SDKs having multiple keys for debug/release builds.

Thanks for going through and giving any response if you have.

oyeraghib
  • 878
  • 3
  • 8
  • 26

1 Answers1

0

I'd say check out the Startup library.

It lets you create separate classes that extend Initializer<T> and each one can manage its own initialization and specify dependencies too. The library will handle the initialization order for you, so you can focus on keeping each SDK initializer in its own class.

And you can use build configurations to differentiate between debug and release within each Initializer.

Kylaaa
  • 6,349
  • 2
  • 16
  • 27