First of all you should know that you can extend Android.Application class so you can access two important methods related with app lifecycle:
OnCreate - Called when the application is starting, before any other application objects have been created (like MainActivity).
OnTerminate -
This...