The custom renderer for Android does the same thing as it does for iOS, but with the additional step of checking permissions. Let's create the ARViewRenderer class for Android by going through the following steps:
- In the WhackABox.Droid project, create a folder called Renderers.
- In that folder, add a new class called ARViewRenderer.
- Add the following code to the class:
using System.Threading.Tasks;
using Android;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Support.V4.App;
using Android.Support.V4.Content;
using WhackABox.Droid.Renderers;
using WhackABox;
using WhackABox.Controls;
using WhackABox.Droid;
using Urho.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(ARView),
typeof(ARViewRenderer))]
namespace WhackABox.Droid.Renderers
{
public class ARViewRenderer : ViewRenderer<ARView,
Android.Views.View>
{
private UrhoSurfacePlaceholder...