In the Android bootstrapper, we will have configurations that are specific to the Android app. To create the bootstrapper in Android, follow these steps:
- In the Android project, create a new class called Bootstrapper.
- Make the new class inherit from MeTracker.Bootstrapper.
- Write the following code:
using Autofac;
using MeTracker.Droid.Services;
using MeTracker.Services;
namespace MeTracker.Droid
{
public class Bootstrapper : MeTracker.Bootstrapper
{
public static void Init()
{
var instance = new Bootstrapper();
}
protected override void Initialize()
{
base.Initialize();
ContainerBuilder.RegisterType<LocationTrackingService()
.As<ILocationTrackingService>().SingleInstance();
}
}
}
- Go to the MainActivity.cs file in the Android project.
- Before the call to LoadApplication, in the OnCreate method, call the...