Beispiel #1
0
        public void runActivityTrackerService()
        {
            activityTracker = new ActivityTracker();
            Thread activityTrackerThread = new Thread(
                new ThreadStart(activityTracker.trackActivity));

            activityTrackerThread.Start();
        }
Beispiel #2
0
        public void stopServices()
        {
            ActivityTracker.stop();
            ScreenshotManager.stop();
            UserInteractionManager.stop();
            URLFetcher.stop();

            isStarted = false;
        }
Beispiel #3
0
        public void getData()
        {
            ConcurrentStack <DataCollectionStructure> activityTrackerData =
                ActivityTracker.getDataAndResetCollector();
            ConcurrentStack <DataCollectionStructure> userInteractionData =
                UserInteractionManager.getDataAndResetCollector();
            ConcurrentStack <DataCollectionStructure> urlFetcherService =
                URLFetcher.getDataAndResetCollector();

            IEnumerator <DataCollectionStructure> activityTrackerDataIterator = activityTrackerData.GetEnumerator();
            IEnumerator <DataCollectionStructure> userInteractionDataIterator = userInteractionData.GetEnumerator();
            IEnumerator <DataCollectionStructure> urlFetcherServiceIterator   = urlFetcherService.GetEnumerator();

            String data = "Activity Tracker: \r\n";

            while (activityTrackerDataIterator.MoveNext())
            {
                data += activityTrackerDataIterator.Current.ToString();
            }

            data += "\r\nUserInteraction:\r\n";
            while (userInteractionDataIterator.MoveNext())
            {
                data += userInteractionDataIterator.Current.ToString();
            }

            data += "\r\nURL fetcher:\r\n";
            while (urlFetcherServiceIterator.MoveNext())
            {
                data += urlFetcherServiceIterator.Current.ToString();
            }

            ScreenshotManager.takeScreenshot(localCacheFolder + "/photo.jpg");

            writeDataToFile(localCacheFolder + "/fisier.txt", data);
        }