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 method is for use in emulated process environments. It will never be called on a production Android device, where processes are removed by simply killing them; No user code (including this callback) is executed when doing so. From the documentation: https://developer.android.com/reference/android/app/Application.html#onTerminate()
In Xamarin.Android application you can extend Application class in the way presented below. Add new class called "MyApplication.cs" to your project:
[Application]
public class MyApplication : Application
{
public MyApplication(IntPtr handle, JniHandleOwnership ownerShip) : base(handle, ownerShip)
{
}
public override void OnCreate()
{
base.OnCreate();
}
public override void OnTerminate()
{
base.OnTerminate();
}
}
As you wrote above you can use OnCreate method. You can for instance initialize local database here or setup some additional configuration.
There is also more methods which can be overridden like: OnConfigurationChanged or OnLowMemory.