In the Android bootstrapper, we will have configurations that are specific to the Android app. To create a bootstrapper in Android, we will go through the following steps:
- In the Android project, create a new class and name it Bootstrapper.
- Make the new class inherit from HotDogOrNot.Bootstrapper.
- Write the following code and resolve all the references:
using System;
using Autofac;
public class Bootstrapper : HotDogOrNot.Bootstrapper
{
public static void Init()
{
var instance = new Bootstrapper();
}
protected override void Initialize()
{
base.Initialize();
ContainerBuilder.RegisterType<TensorflowClassifier>
().As<IClassifier>().SingleInstance();
}
}
- Go to the MainActivity.cs file in the Android project.
- Before the call to LoadApplication, in the OnCreate method, call the...