Exemple #1
0
        public App()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
                Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
                Microsoft.ApplicationInsights.WindowsCollectors.Session);

            InitializeComponent();

            Suspending += OnSuspending;

            CustomLogger.PlatformLogger = new WindowsLogger();

            BackpackPlannerState = new BackpackPlannerState(
                new HockeyAppManager(),
                new WindowsSettingsManager(),
                new WindowsPlayServicesManager(),
                new WindowsDatabaseSyncManager(),
                new SQLitePlatformWinRT()
            );
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _startupStopwatch.Start();

            CustomLogger.PlatformLogger = new DroidLogger();

            BackpackPlannerState = new BackpackPlannerState(
                new HockeyAppManager(),
                new DroidSettingsManager(Android.Support.V7.Preferences.PreferenceManager.GetDefaultSharedPreferences(this)),
                new DroidPlayServicesManager(this),
                new DroidDatabaseSyncManager(),
                new SQLitePlatformAndroid()
            );

            LoadPreferences();

            BackpackPlannerState.InitAsync().Wait();

            ((HockeyAppManager)BackpackPlannerState.PlatformHockeyAppManager).OnCreate(this);
            ((DroidPlayServicesManager)BackpackPlannerState.PlatformPlayServicesManager).OnCreate(savedInstanceState);
        }