/// <summary>
        /// Query application history according to its type
        /// </summary>
        /// <param name="queryType">Application history type to query</param>
        private void Query(QueryType queryType)
        {
            try
            {
                switch (queryType)
                {
                case QueryType.RecentlyUsedApplications:
                    statsInfo = appHistoryAPIs.QueryRecentlyUsedApplications();
                    break;

                case QueryType.FrequentlyUsedApplications:
                    statsInfo = appHistoryAPIs.QueryFrequentlyUsedApplications();
                    break;

                case QueryType.BatteryConsumingApplications:
                    statsInfo = appHistoryAPIs.QueryBatteryConsumingApplications();
                    break;

                default:
                    statsInfo = null;
                    break;
                }
            }
            catch (Exception e)
            {
                DependencyService.Get <ILog>().Log(e.Message.ToString());
            }
        }
Example #2
0
        /// <summary>
        /// Query application history according to its type
        /// </summary>
        /// <param name="queryType">Application history type to query</param>
        private void Query(QueryType queryType)
        {
            try
            {
                switch (queryType)
                {
                case QueryType.RecentlyUsedApplications:
                    statsInfo = appHistoryAPIs.QueryRecentlyUsedApplications();
                    break;

                case QueryType.FrequentlyUsedApplications:
                    statsInfo = appHistoryAPIs.QueryFrequentlyUsedApplications();
                    break;

                case QueryType.BatteryConsumingApplications:
                    statsInfo = appHistoryAPIs.QueryBatteryConsumingApplications();
                    break;

                default:
                    statsInfo = null;
                    break;
                }
            }
            catch (Exception e)
            {
                log.Log(e.Message);
            }
        }