My app do lot of background tasks and has few activities and most of the work is done in background.
Suppose I add timber and Crashlytics to my app. How can I make sure than when the app is updated on the device, timber, and Crashlytics get initialized without activity being opened.
                        
When you update your app, it's always stopped and restarted - Timber and Crashlytics can be initialized at this moment.
When your application starts, method
onCreate()ofandroid.app.Applicationclass is invoked. To add extra logic to this method, you need to create new MyApplication class, which extendsApplicationclass and overrideonCreate()method.By default,
android.app.Applicationclass is used to initialize application context. Information about that anotherApplicationclass is used should be provided inAndroidManifest.xmlfile.