<commit_before>using Avalonia.Android.CanvasRendering;
using Avalonia.Android.Platform;
using Avalonia.Android.Platform.Input;
using Avalonia.Android.Platform.Specific;
using Avalonia.Controls.Platform;
using Avalonia.Input;
using Avalonia.Input.Platform;
using Avalonia.Platform;
using Avalonia.Shared.PlatformSupport;
using Avalonia.Skia;
using System;
using System.Collections.Generic;
using Avalonia.Android.Platform.SkiaPlatform;
using System.IO;

namespace Avalonia.Android
{
    public class AndroidPlatform : IPlatformSettings, IWindowingPlatform, IPlatformIconLoader
    {
        public static readonly AndroidPlatform Instance = new AndroidPlatform();
        public Size DoubleClickSize => new Size(4, 4);
        public TimeSpan DoubleClickTime => TimeSpan.FromMilliseconds(200);
        public double RenderScalingFactor => _scalingFactor;
        public double LayoutScalingFactor => _scalingFactor;

        private readonly double _scalingFactor = 1;

        AndroidPlatform()
        {
            AvaloniaLocator.CurrentMutable
                .Bind<IClipboard>().ToTransient<ClipboardImpl>()
                .Bind<IStandardCursorFactory>().ToTransient<CursorFactory>()
                .Bind<IKeyboardDevice>().ToSingleton<AndroidKeyboardDevice>()
                .Bind<IMouseDevice>().ToSingleton<AndroidMouseDevice>()
                .Bind<IPlatformSettings>().ToConstant(this)
                .Bind<IPlatformThreadingInterface>().ToConstant(new AndroidThreadingInterface())
                .Bind<ISystemDialogImpl>().ToTransient<SystemDialogImpl>()
                .Bind<ITopLevelRenderer>().ToTransient<AndroidTopLevelRenderer>()
                .Bind<IWindowingPlatform>().ToConstant(this);

            SkiaPlatform.Initialize();

            _scalingFactor = global::Android.App.Application.Context.Resources.DisplayMetrics.ScaledDensity;

            
            //we have custom Assetloader so no need to overwrite it
            
        }

        public void Init(Type applicationType)
        {
            SharedPlatform.Register(applicationType.Assembly);
        }

        public IWindowImpl CreateWindow()
        {
            return new WindowImpl();
        }

        public IWindowImpl CreateEmbeddableWindow()
        {
            throw new NotImplementedException();
        }

        public IPopupImpl CreatePopup()
        {
            throw new NotImplementedException();
        }

        public IWindowIconImpl LoadIcon(string fileName)
        {
            return null;
        }

        public IWindowIconImpl LoadIcon(Stream stream)
        {
            return null;
        }<commit_msg>Added AppBuilder and Initialize<commit_after>using System;
using System.IO;
using Avalonia.Android.CanvasRendering;
using Avalonia.Android.Platform;
using Avalonia.Android.Platform.Input;
using Avalonia.Android.Platform.SkiaPlatform;
using Avalonia.Controls;
using Avalonia.Controls.Platform;
using Avalonia.Input;
using Avalonia.Input.Platform;
using Avalonia.Platform;
using Avalonia.Shared.PlatformSupport;

namespace Avalonia
{
    public static class AndroidApplicationExtensions
    {
        public static AppBuilder UseAndroid(this AppBuilder builder)
        {
            builder.WindowingSubsystem = Avalonia.Android.AndroidPlatform.Initialize;
            return builder;
        }
    }
}

namespace Avalonia.Android
{
    public class AndroidPlatform : IPlatformSettings, IWindowingPlatform, IPlatformIconLoader
    {
        public static readonly AndroidPlatform Instance = new AndroidPlatform();
        public Size DoubleClickSize => new Size(4, 4);
        public TimeSpan DoubleClickTime => TimeSpan.FromMilliseconds(200);
        public double RenderScalingFactor => _scalingFactor;
        public double LayoutScalingFactor => _scalingFactor;

        private readonly double _scalingFactor = 1;

        public AndroidPlatform()
        {
            _scalingFactor = global::Android.App.Application.Context.Resources.DisplayMetrics.ScaledDensity;
        }

        public static void Initialize()
        {
            AvaloniaLocator.CurrentMutable
                .Bind<IClipboard>().ToTransient<ClipboardImpl>()
                .Bind<IStandardCursorFactory>().ToTransient<CursorFactory>()
                .Bind<IKeyboardDevice>().ToSingleton<AndroidKeyboardDevice>()
                .Bind<IMouseDevice>().ToSingleton<AndroidMouseDevice>()
                .Bind<IPlatformSettings>().ToConstant(Instance)
                .Bind<IPlatformThreadingInterface>().ToConstant(new AndroidThreadingInterface())
                .Bind<ISystemDialogImpl>().ToTransient<SystemDialogImpl>()
                .Bind<ITopLevelRenderer>().ToTransient<AndroidTopLevelRenderer>()
                .Bind<IWindowingPlatform>().ToConstant(Instance);
        }

        public void Init(Type applicationType)
        {
            SharedPlatform.Register(applicationType.Assembly);
        }

        public IWindowImpl CreateWindow()
        {
            return new WindowImpl();
        }

        public IWindowImpl CreateEmbeddableWindow()
        {
            throw new NotImplementedException();
        }

        public IPopupImpl CreatePopup()
        {
            throw new NotImplementedException();
        }

        public IWindowIconImpl LoadIcon(string fileName)
        {
            return null;
        }

        public IWindowIconImpl LoadIcon(Stream stream)
        {
            return null;
        }
{'fraction_non_alphanumeric': 0.08144631117604091, 'fraction_numerical': 0.002191380569758948, 'mean_word_length': 2.622354497354497, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4433433', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1343, 'n_words': 261}