Beispiel #1
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            // Re-configure sync since user may have changed sync preferences
            DataSyncReceiver.ConfigureSync(this);
        }
        protected async override void OnHandleIntent(Intent intent)
        {
            Log.Debug("Handling synchronization request");

            using (var cancellationSource = new CancellationTokenSource()) {
                Log.Debug("Sync service running");

                var syncResult = await App.Sync.Synchronize(cancellationSource.Token);

                Log.Debug("Sync service completing with {0}: {1} points uploaded in {2} chunks",
                          (syncResult.HasFailed) ? "failure" : "success",
                          syncResult.PointsUploaded,
                          syncResult.ChunksUploaded);
            }

            DataSyncReceiver.CompleteWakefulIntent(intent);
        }
Beispiel #3
0
        public override void OnCreate()
        {
            base.OnCreate();

            Log.Debug("Synchronous app initialization");

            try {
                App.Initialize(this, ApplicationContext).Wait();
            }
            catch (Exception ex) {
                Log.Error(ex, "Failed to initialize app");
                throw;
            }

            Log.Debug("Completing Android initialization");

            RegisterActivityLifecycleCallbacks(_lifecycleHandler);

            DataSyncReceiver.ConfigureSync(this);

            CalibrationUi = new CalibrationUiManager();
        }