Zeus make application start quickly
- Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.iamdennisme:Zeus:x.y.z'
}
class TestTask : Task() {
override fun needWait(): Boolean {
return true
}
override fun run() {
Thread.sleep(2000)
//do your init
}
}
class TestApplication : Application() {
override fun onCreate() {
super.onCreate()
Zeus.init(this)
Zeus.createInstance().run {
addTask(TestTask())
.start()
await()
}
}
}