<commit_before>using System;

using Android.App;
using Android.OS;
using Android.Runtime;
using Plugin.CurrentActivity;
using MyTrips.Utils;
using MyTrips.Interfaces;
using MyTrips.Droid.Helpers;
using Acr.UserDialogs;
using MyTrips.Shared;
using MyTrips.DataStore.Abstractions;

namespace MyTrips.Droid
{
    [Application]
    public class MainApplication : Application, Application.IActivityLifecycleCallbacks
    {
        public MainApplication(IntPtr handle, JniHandleOwnership transer)
          : base(handle, transer)
        {
        }

        public override void OnCreate()
        {
            base.OnCreate();
            RegisterActivityLifecycleCallbacks(this);
            ViewModel.ViewModelBase.Init();
            ServiceLocator.Instance.Add<IAuthentication, Authentication>();
            ServiceLocator.Instance.Add<MyTrips.Utils.Interfaces.ILogger, MyTrips.Shared.PlatformLogger>();
            ServiceLocator.Instance.Add<IHubIOT, IOTHub>();
            ServiceLocator.Instance.Add<IOBDDevice, OBDDevice>();

            ServiceLocator.Instance.Add<IHubIOTStore, MyTrips.DataStore.Mock.Stores.IOTHubStore>();
            //ServiceLocator.Instance.Add<IHubIOTStore, MyTrips.DataStore.Azure.Stores.IOTHubStore>();

            #if !XTC
            Xamarin.Insights.Initialize(Logger.InsightsKey, this);
            #endif

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            UserDialogs.Init(() => CrossCurrentActivity.Current.Activity);
        }

        public override void OnTerminate()
        {
            base.OnTerminate();
            UnregisterActivityLifecycleCallbacks(this);
        }

        public void OnActivityCreated(Activity activity, Bundle savedInstanceState) => CrossCurrentActivity.Current.Activity = activity;

        public void OnActivityDestroyed(Activity activity) { }

        public void OnActivityPaused(Activity activity) { }

        public void OnActivityResumed(Activity activity) => CrossCurrentActivity.Current.Activity = activity;

        public void OnActivitySaveInstanceState(Activity activity, Bundle outState) {}

        public void OnActivityStarted(Activity activity)
        {
            CrossCurrentActivity.Current.Activity = activity;
            #if !XTC
            HockeyApp.Tracking.StartUsage(activity);
            #endif
        }

        public void OnActivityStopped(Activity activity)
        {
            #if !XTC
            HockeyApp.Tracking.StopUsage(activity);
            #end
        }

    }
}<commit_msg>add endif<commit_after>using System;

using Android.App;
using Android.OS;
using Android.Runtime;
using Plugin.CurrentActivity;
using MyTrips.Utils;
using MyTrips.Interfaces;
using MyTrips.Droid.Helpers;
using Acr.UserDialogs;
using MyTrips.Shared;
using MyTrips.DataStore.Abstractions;

namespace MyTrips.Droid
{
    [Application]
    public class MainApplication : Application, Application.IActivityLifecycleCallbacks
    {
        public MainApplication(IntPtr handle, JniHandleOwnership transer)
          : base(handle, transer)
        {
        }

        public override void OnCreate()
        {
            base.OnCreate();
            RegisterActivityLifecycleCallbacks(this);
            ViewModel.ViewModelBase.Init();
            ServiceLocator.Instance.Add<IAuthentication, Authentication>();
            ServiceLocator.Instance.Add<MyTrips.Utils.Interfaces.ILogger, MyTrips.Shared.PlatformLogger>();
            ServiceLocator.Instance.Add<IHubIOT, IOTHub>();
            ServiceLocator.Instance.Add<IOBDDevice, OBDDevice>();

            ServiceLocator.Instance.Add<IHubIOTStore, MyTrips.DataStore.Mock.Stores.IOTHubStore>();
            //ServiceLocator.Instance.Add<IHubIOTStore, MyTrips.DataStore.Azure.Stores.IOTHubStore>();

            #if !XTC
            Xamarin.Insights.Initialize(Logger.InsightsKey, this);
            #endif

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            UserDialogs.Init(() => CrossCurrentActivity.Current.Activity);
        }

        public override void OnTerminate()
        {
            base.OnTerminate();
            UnregisterActivityLifecycleCallbacks(this);
        }

        public void OnActivityCreated(Activity activity, Bundle savedInstanceState) => CrossCurrentActivity.Current.Activity = activity;

        public void OnActivityDestroyed(Activity activity) { }

        public void OnActivityPaused(Activity activity) { }

        public void OnActivityResumed(Activity activity) => CrossCurrentActivity.Current.Activity = activity;

        public void OnActivitySaveInstanceState(Activity activity, Bundle outState) {}

        public void OnActivityStarted(Activity activity)
        {
            CrossCurrentActivity.Current.Activity = activity;
            #if !XTC
            HockeyApp.Tracking.StartUsage(activity);
            #endif
        }

        public void OnActivityStopped(Activity activity)
        {
            #if !XTC
            HockeyApp.Tracking.StopUsage(activity);
            #endif
        }

    }
}
{'fraction_non_alphanumeric': 0.08661417322834646, 'fraction_numerical': 0.0, 'mean_word_length': 2.7087591240875915, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '5320626', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1312, 'n_words': 233}