AndroidTrack: An Investigation of Using Social Networks’ Applications in Android Platforms

In this paper, time spent and the repetition of using the Social Network Sites (SNS) in Android applications are investigated. In this approach, we seek to raise the awareness and limit, but not eliminate the repeated uses of SNS, by introducing AndroidTrack. This AndroidTrack is an android application that was designed to monitor and apply valid experimental studies in order to improve the impacts of social media on Iraqi users. Data generated from the app were aggregated and updated periodically at Google Firebase Real-time Database. The statistical factor analysis (FA) was presented as a result of the user’s interactions.


Introduction
Nowadays, many teenagers have access to smartphones. The percentage of usage rose from approximately 45% to 75% in 2010, and the number continued to increase in 2015 to 88% [1]. There are android monitoring apps that aid in spying on other's activities in the system, such as Mspy and Spyzie. These apps can monitor employees' activities outside of work hours and protect in times of need for parental control [2] [3]. A survey has been conducted between three universities in Iraq. This
Iraqi Journal of Science, 2021, Vol. 62, No. 7, pp: 2445-2453 2446 survey showed that social media can play a major role in changing political events. The academic performance application, as well as Facebook and Youtube applications lead the social media platforms to be in continuous usage [4]. The rapid diffusion of the online applications made the activities to exceed the accepted parameters of using the applications [5]. The remarkable growth of using social media could cause problematic habits that can be dangerous to the user's life in Iraq. Activists and journalists have been assassinated because of their posts on social media accounts [6]. Recently, Al-Hashimi, an Iraqi researcher on ideological security was assassinated due to his social and political activities [7][8][9]. These manifestations can be stopped by imposing social media regulations, increasing peoples' awareness, and/or developing social media management systems. In this paper, the proposed approach is to highlight the relative timing of participants' natural behavior and time spending on Social Networks Sites (SNS), using an Android application. The application can profile each user's application to draw an inference about the possible causal sequence of a using social media applications In this paper, the proposed application is designed to track the users' application activities. AndroidTrack is presented to extract the time and the repetition of the use of each user's applications in a novel approach. The main objective of this work is to build an experimental application that gives real-time monitoring of social media applications. The data lifecycle passes through two phases. First, the mobile traffic is stored at the SQLite database. Second, the stored data dispatches to Google Firebase real-time database, where the data are structured in a JSON format, and formalized for statistical analysis. The remainder of this paper is divided as follows: Section 2 gives an insight into the existing similar platforms and related work. Section 3 contains information about the application architecture and implementation. Section 4 summarizes the main scoring of the work. Section 5 concludes the study and suggests a future work.

Related Work
Several general-purpose applications or specific group of user's applications that enable the storage, analysis, and visualization of the collected space-time information were being used to track activities. These activities are applied in the EailyTracker application [10]. The users were able to monitor their route planning and map visualization through GPS location. However, there was not an interaction between the active application and the observer, which could be possible through an intermediary server that makes the connection between a hidden service and the monitoring platform. Runtime information gathering (RIG) activities, such as recording phone call conversations and gathering data usages to infer disease information, are considered as serious to sensitive information and Android security. An earlier work [11] stated the vulnerability of RIG while using smart phone to control homes and automobile over the network. The pros of monitoring apps activities are often restricted on how far social media apps could lower mental health, such as self-esteem and loneliness. Several studies were able to find that the behavior of users on Facebook was measurable and subjected to increase/decrease in well-being over time [12][13].
Automatic tracking using mobile applications can record usage information passively without requiring user involvement. This technique highlighted the benefits of collecting large amounts of data. In a previous investigation [14], a web-based android to was designed to interact, collect surveys, and self-monitored tasks for m-health studies. The designed application was capable of collecting data using an accelerometer, GPS, WiFi, microphone audio recordings, and cell tower logs. Despite the application's capabilities, the heavy resources implemented could drain the phone battery. M. N. Hoq et al. [15] however used both android and web applications along with a GPS tracking system to monitor the children's location through a website. This study did not go further to track app activities, like children's well-being and behaviors. Mobile applications and wearable technologies enabled individuals to enhance psychological services and integrate a large number of assistance to reorganize taxonomies of mental health, such as sensing of mood, whether from speech or heart rate variability [16].
Mood 24/7 app [17] was developed through a partnership between Johns Hopkins University and The Health Central Network Inc. Virginia, USA. Mood 24/7 app used text messages to track, share, and provide daily reliable mood charts for users with a secure website. This technology had the advantage of being widely available and used in rural regions that are characterized by poverty in the USA, where there are limited use and access to the internet and computer. This direct observation method acts as shadowing and provides a rich qualitative amount of human behavior. myCompass [18] is an E-health platform that contains 12 modules targeting the most common mental health problems (e.g. anxiety, sleep disturbances, depression, and stress). Participants can choose from these modules, which consist of several questions on a certain topic, such as sleep deprivation or anxiety. However, participants can log into myCompass through a web browser (on a computer, tablet, or mobile phone), where no separate applications for tablets/mobile phones were constructed. SNS has a direct impact on users' time and life. Therefore, the challenge is to find out how far each user could spend on the social network applications to give an insight overview in a novel approach.

The AndroidTrack Design and Implementation
The difference between social media and social networks is noteworthy here to be mentioned. Social media can be in the form of a web-based communication application that lets users to share and interact with each other. On the other side, social networks are social platforms technology that creates users in a group list to communicate with each other. The proposed application can track both platforms and monitor the social time used and frequency of use. AndroidTrack is built at a minimum API level 22 and a target of API 29 to track the other applications in the system. Google Firebase real-time database is selected to store the variable results of the users' applications. Figure-1 shows the Android front end UI, while Figure-2 presents an overview of the proposed application. Each user has a unique registration to use the app. Nineteen-users from age 19 to 27, from the University of Al-Hamdaniya-Iraq, are instructed to download the app apk file. The parameters observed, which are the spent time and the repetition of the applications, are discussed later in the results section. Once the registration is made, the user has to grant permissions to access the device history and statistics. By using "UsageStatsManager" and "NetworkStatsManager" classes, illustrated in Table-1, in Android studio, the data are aggregated and read in a daily time interval.

PackageManager
Finds global package information about the installed apps.
NetworkStatsManager Provides a query network usage summary.

UsageStatsManager
Provides the device's history and statistics on a daily, weekly, monthly, or yearly interval. FirebaseDatabase An entry database point to read and write from Google Firebase.

SQLiteDatabase
Creates, executes, and deletes database tasks.  The app will start to log the applications' time, date, and repetition, in addition to age and gender data. A drop-down list is also present that includes four options to choose from: 1-I use social media for academic purposes. 2-I use social media for business. 3-I use social media to watch political events. 4-I use social media to check friends' posts. The categorized data is useful to distinguish the users' habits based on the four categories and to cross-validate the user's application usage. In addition, it can show an easy implementation method compared with that previously described [4]. These SQLite database variables are converted into the firebase real-time database and stored as a JSON file format. At the firebase side, each user is tree-level structured with a unique ID. Figure-3 shows the data flow chart of the application, whereas Figure-4 presents a captured snapshot of the JSON file structure at Google firebase real-time database.

Data Collection and Scoring
The application offers the possibility of collecting the event-driven activities in Android platform. The application is also capable of tracking the application package in the system. As a result, observations are made on data from 19 users who downloaded the application. Twenty-five applications were taken from each user. Factor Analysis (FA) is applied for these datasets and the most effective 14 applications were taken into consideration. The data were extracted in a daily time interval. Factor analysis [19] assumes several assumptions, such as: there is a linear relationship, there is no multicollinearity, there are relevant variables into the analysis, and there is a true correlation between variables and factors. Several methods are available, but the principal component analysis is the most commonly used. Basically, factor analysis is a technique that is used for reducing a large number of variables into fewer numbers of factors. This technique extracts the maximum common variance from all variables and puts them into a common score. As an index of all variables, this score can be applied for further analysis. Factor analysis is also part of the general linear model (GLM).

Statistical Analysis based on the number of times of applications' usage
After the usage of factor analysis and the method of principal component analysis, we found seven main factors. Each having a relation with all the applications that we used in our study. This is the main idea of the factor analysis, that is the reduction of the large number of variables to a few number of factors. These factors affect the number of times of using the android applications by users, through these results and the degree of their saturation in each of the seven factors, where saturation represents a simple correlation coefficient between the factor and the variable in terms of the number of times of application usage. The statistical results are presented in Table 2. Table-2 presents the applications that showed the largest values of saturation in each of the seven factors that were extracted from the statistical analysis. These results are presented with two cases; the first one is before factors' rotation, whereas the second is after factors' rotation and carrying out again the analysis. The main purpose of rotation is to redistribute the saturation of the variables to the factors, so that the saturation of the particular/specific factor does not affect the remaining of the factors. The value of the saturation is between -1 and +1 and, as seen in Table-2, most of the saturation values of the factors are negative, which means that the correlation is reverse but, in the same time, it is a strong correlation that is near -1. The reverse correlation between factors means that when one is increasing, the other is decreasing. Figure-5 shows the correlation between the seven main factors and the eigenvalues resulting from the statistical analysis. The eigenvalue measures the size of the variance in all variables that are calculated using one factor. The eigenvalue does not represent the explanation ratio of the variance. In fact, it measures the size of the variance and is used for comparison purposes between the effects of every variable in the factor. The factor is accepted when the value of the eigenvalue is greater than the correct one (+1), and if its value is less than one, then the factor is rejected. In other words, the eigenvalue is the sum of squares of the contributions of all the variables on each factor of the matrix separately. Its value decreases from one factor to another according to the order, so the first factor has a value greater than that of the next factor. Table-3 presents the eigenvalues and the ratios of variance for each factor from the total variance:

Statistical Analysis based on the Period of Applications' Usage
The factor analysis is carried out for the applications based on the period of the applications' usage. The saturation of the applications for the main seven factors in this case is presented in Table-4. In Figure-6, the correlation between the main factors and the eigenvalues is shown based on the period of the applications' usage. The eigenvalue and the ratio of variance for each factor from the total variance are presented in Table-5. It is revealed through the outcomes presented above that social communication applications are the most used ones among the android applications. In addition, they are the most closely related ones in terms of the number of times of use (repetition) and the period of usage. We derive that these applications can take the largest part of the user's attention for both genders. Using these applications becomes not only a limit to social communication but they are also used to facilitate academic work and interests.   As previously explained in the eigenvalue measures, it is noticed from the results in table 5 that the values of the factor 7 are less than +1 and therefore they are not included in the factors' list, which explains the variance ratio of the sum of the squares loading of variables.

Conclusions and Future Work
The cross-functionality of the AndroidTrack can be considered as a useful guide for therapeutic recommendations. In this paper, the proposed tracking mechanisms can periodically send the data over Google Firebase real-time database, where the data is extracted for Factor analysis. We profiled 19 users with their application name packages. Each user showed different application uses and timefrequency of usage. AndroidTrack can derive useful nuggets of information on individual applications, where it is not intended to monitor user behavior. So far, all the related studies used the conventional methods of collecting data to analyze the social applications' usage. Future work could go further into a more precise investigation, where we can force to stop the apps (take a rest) based on the role of the app, either as a consumer or as a producer of the data. This could be accomplished by applying the network traffic metric APIs.

Conflict of Interest
The authors declare that they have no conflict of interest.