Esempio n. 1
0
        /// <summary>
        /// Initialize sensor core.
        /// </summary>
        /// <returns>Asynchronous task/returns>
        public async Task InitializeSensorAsync()
        {
            // Make sure all necessary settings are enabled
            await ValidateSettingsAsync();

            if (_runningInEmulator)
            {
                // await CallSensorCoreApiAsync( async () => { _activityMonitor = await ActivityMonitorSimulator.GetDefaultAsync(); } );
            }
            else
            {
                // Get the activity monitor instance
                await CallSensorCoreApiAsync(async() =>
                {
                    _activityMonitor = await ActivityMonitor.GetDefaultAsync();
                });
            }
            if (_activityMonitor == null)
            {
                // Nothing to do if we cannot use the API
                Application.Current.Exit();
            }
        }
        /// <summary>
        /// Initialize sensor core.
        /// </summary>
        /// <returns>Asynchronous task/returns>
        public async Task InitializeSensorAsync()
        {
            // Make sure all necessary settings are enabled
            await ValidateSettingsAsync();

            if (_runningInEmulator)
            {
                // await CallSensorCoreApiAsync( async () => { _activityMonitor = await ActivityMonitorSimulator.GetDefaultAsync(); } );
            }
            else
            {
                // Get the activity monitor instance
                await CallSensorCoreApiAsync(async () =>
                {
                    _activityMonitor = await ActivityMonitor.GetDefaultAsync();
                });
            }
            if (_activityMonitor == null)
            {
                // Nothing to do if we cannot use the API
                Application.Current.Exit();
            }
        }