## 3 Materials and Methods
### Web Ecosystem Design and Proof of Concept Implementation
#### 3.2.2 Smartphone Application  
The second main element of SENIOR is the Android application installed in the smartphone. This application is compatible with Android smartphones with version 6 or higher. Additionally, it asks the user for permissions about execution in the background, network access, Bluetooth connections and location. In terms of storage, it uses the private space of the application, increasing the confidentiality of the temporal data stored. Figure 1: Main elements of the SENIOR web ecosystem. Figure 2: Complete architecture of SENIOR, including all communication flow between elements. The functionality of this element of the SENIOR ecosystem is presented in Figure 3. The application acquires information related to users' physical data using the Omron device via the provided SDK and, particularly, blood pressure values, heart rate, and the number of steps. After each blood pressure measurement, it sends these three datapoints to the web platform. Furthermore, the application presents multiple types of surveys to cover different mental and sociological aspects, including healthy habits of the users concerning physical activity, diet, and consumption of harmful substances such as alcohol or tobacco. On the other hand, each user must register to create a profile, also used for authentication. Some of these fields represent features that are later considered by the ML models. Finally, the application gathers the user's geographical coordinates using the GPS, essential to consult the weather and pollution values of the environment. After presenting the architecture of the application, we describe the SDK provided by Omron to link the wearable to the application. The device is controlled by three processes subsequently presented:  
* Scanning: the application uses the Bluetooth of the smartphone to search for devices compatible with the SDK, returning a list of objects representing these devices. This kind of object allows the connection with the wearable and filters for a specific model during the search. * Connection: with the selected object, we need to complete the configuration of the wearable, specifying the weight, height, and stride of the user. On the other hand, we can configure alarms, date format, and temporal windows to collect sleep data. When we initiate the connection process, the communication between the devices starts, returning an object representing the linked device. With this resulting object, we will be able to start data transfers. * Transfer: with the previously indicated object, we can access blood pressure, steps, and sleep data stored in the application, including timestamps of the measurements. After introducing the connection between the wearable and the application, we present the functioning of the different views and services defining the application. Figure 4 describes the architecture of the proposed application differentiating two main categories of elements, those representing background processes and those managing the views shown to the user. The application is designed for working in the background, gathering data automatically without requiring interaction from the user, except for completing surveys. Figure 3: Data dimensions acquired by the smartphone application. If these data cannot be sent to the web platform due to connection issues, the application backups this data and tries to send them afterward. First, we will introduce the user's interface since some of the background services depend on them. The user's first view is the login interface (Figure 5a), where the user can register or log in if already registered. In the case of a login operation, the smartphone sends the information to the server to verify if the user already exists. If the provided credentials were correct, the user accesses the main menu of the application (Figure 5c). However, if it is the case of a new user, the register button will present the register process (Figure 5b), asking to provide the required user data.