public void SyncDatabaseInBackground(PlayServicesManager playServicesManager)
        {
            if(null == playServicesManager || !playServicesManager.IsConnected) {
                return;
            }

            Logger.Info("Starting database sync task...");
            Task.Run(async () => {
                PlayServicesManifest localManifest = await ReadLocalManifest().ConfigureAwait(false);
                if(null == localManifest) {
                    localManifest = new PlayServicesManifest();
                    await WriteLocalManifset(localManifest).ConfigureAwait(false);
                }
    
                PlayServicesManifest remoteManifest = await ReadRemoteManifest().ConfigureAwait(false);
                if(null == remoteManifest) {
                    remoteManifest = new PlayServicesManifest();
                    await WriteRemoteManifestFile(playServicesManager).ConfigureAwait(false);
                }

                if(ShouldPull(localManifest)) {
                    await PullDatabaseFile(playServicesManager).ConfigureAwait(false);
                } else if(ShouldPush(localManifest, remoteManifest)) {
                    await PushDatabaseFile(playServicesManager).ConfigureAwait(false);
                } else {
                    SyncConflictAction conflictResolutionAction = await GetConflictResolutionAction().ConfigureAwait(false);
                    switch(conflictResolutionAction)
                    {
                    case SyncConflictAction.Push:
                        await PushDatabaseFile(playServicesManager).ConfigureAwait(false);
                        break;
                    case SyncConflictAction.Pull:
                        await PullDatabaseFile(playServicesManager).ConfigureAwait(false);
                        break;
                    }
                }

                Logger.Info("Database sync task complete!");
            });
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BackpackPlannerState" /> class.
        /// </summary>
        /// <param name="platformHockeyAppManager">The platform HockeyApp manager.</param>
        /// <param name="platformSettingsManager">The platform settings manager.</param>
        /// <param name="platformPlayServicesManager">The platform google play services manager.</param>
        /// <param name="platformDatabaseSyncManager">The platform database sync manager.</param>
        /// <param name="sqlitePlatform">The SQLite platform.</param>
        public BackpackPlannerState(IHockeyAppManager platformHockeyAppManager, SettingsManager platformSettingsManager, PlayServicesManager platformPlayServicesManager, DatabaseSyncManager platformDatabaseSyncManager, ISQLitePlatform sqlitePlatform)
        {
            if(null == platformHockeyAppManager) {
                throw new ArgumentNullException(nameof(platformHockeyAppManager));
            }

            if(null == platformSettingsManager) {
                throw new ArgumentNullException(nameof(platformSettingsManager));
            }

            if(null == platformPlayServicesManager) {
                throw new ArgumentNullException(nameof(platformPlayServicesManager));
            }

            if(null == platformDatabaseSyncManager) {
                throw new ArgumentNullException(nameof(platformDatabaseSyncManager));
            }

            if(null == sqlitePlatform) {
                throw new ArgumentNullException(nameof(sqlitePlatform));
            }

            PlatformHockeyAppManager = platformHockeyAppManager;

            PlatformSettingsManager = platformSettingsManager;
            Settings = new BackpackPlannerSettings(PlatformSettingsManager);

            DatabaseState.SQLitePlatform = sqlitePlatform;

            PlatformPlayServicesManager = platformPlayServicesManager;
            PlatformDatabaseSyncManager = platformDatabaseSyncManager;

            PersonalInformation = new PersonalInformation(PlatformSettingsManager, Settings);
        }
        private async Task WriteRemoteManifestFile(PlayServicesManager playServicesManager)
        {
            using(Stream stream = new MemoryStream()) {
                PlayServicesManifest manifest = new PlayServicesManifest();
                await manifest.Write(stream).ConfigureAwait(false);
                await stream.FlushAsync().ConfigureAwait(false);

                stream.Position = 0;
                await playServicesManager.SaveFileToDriveAppFolderAsync(PlayServicesManifest.FileTitle, PlayServicesManifest.ContentType, stream).ConfigureAwait(false);
            }
        }
        private async Task PullDatabaseFile(PlayServicesManager playServicesManager)
        {
await Task.Delay(0).ConfigureAwait(false);
        }