Include JAR in your project and set up SDK
- Download and install the JAR file in your project
- Navigate to your Application class and invoke the Nucleus SDK inside the onCreate method
NucleusSdkInitializer.initialize(this) - Inside your activity class/classes where the user session is triggered, include:
a) a private variable to hold the NucleusSDK
b) assign the private variable a value
c) initialize the SDK itself
See example below
(1) private var nucleusSdk: NucleusSdk? = null
(2) private fun initNucleus() {
val nucleusSdk = NucleusSdkInitializer.getSdk() ?: kotlin.run {
Log.e(TAG, "Nucleus is not initialized!")
// or your logics
return
}
this.nucleusSdk = nucleusSdk
}
(3) override fun onCreate(savedInstanceState: Bundle{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)// or your implementation
initNucleus()
// execute the following if you plan to use SDK in current screen
nucleusSdk.initializeWithActivity(this)
}