## 5 Implementation and Use in MoveUp  
Figure 2 shows a sketch of the classes developed to implement user profiling in MoveUp. The UserRating class is the heart of this functionality, that dialogues with application storage to read/write useful information when necessary through the DBReadWritePoint class services. In particular, two queries are accomplished to extract _MET_ and _SE_ values from database tables and calculate their upper and lower bounds necessary to the calculus of indexes by the equations above. Figure 3 shows this code and a sketch of the database table on which it works. For the sake of clarity, only one week is shown in the figure, codified as number 64 and characterized by two training days. The _blue information flow_ concerns Equation (8), as the average value of _MET_ accomplished by the user over a given time horizon of n weeks is returned; the _green path_ leads to the solution of Equation (5), focusing on the global amount of MET objectives proposed by the app to the user over the same time horizon; finally, the _orange line_ allows to extract useful data about _SE_ for solving Equation (10).  
The user profiling function has been integrated within MoveUp to enable new functionalities. First of all, it has been exploited to give immediate feedback to the user about their performance: the top part of the Figure 4 shows the dedicated GUI.  
The user can select his/her expected level of performance, choosing it among _Turtle_, the avatar of the _static_ profile, _Cat_, a representation of _complicated_ profile, _Leveret_, associated to the _slow but gradual_ profile, and _Cheetah_, related to the _capable_ profile. At the end of the session, the user can ask the system to show them the profile modification according to the real physical and psychological data: this is optional as the possible decrease with respect to user expectations could negatively impact the behavior change plan.  
Second, the profiling model has allowed to include _social_ issues, considering _group physical activities_, which is an important research topic for the mHealth field. For example, group physical activity is more effective than individual to reduce fatigue in patients who have breast cancer; although the comparison with peers can be negatively perceived [55]; it seems to allow aged people [56] to overcome barriers, such as living in not safe neighborhoods and positively impacting on patients with schizophrenia [57]. To promote group PA, a calendar of activities shared among groups of users has been developed in MoveUp: bottom part of Figure 4 shows a sketch of the graphical user interface. First, the user can plan new PA sessions as they prefer, in terms of activity type (e.g., running) and scheduling during the week. Then, they can decide to maintain the activity _private_ or publicize it over the shared calendar to invite others to join the session: _red activities_ in the figure are private training sessions, while _green ones_ are public. Others will see green sessions on their calendars; moreover, they will be able to subscribe to one or more of them (see right part of the figure), receiving information about weather condition forecasts and the group participants' profile (_leveret_ in the figure), to decide if participating or not.  
Figure 3: The query is exploited by the UserRating class to extract necessary information from MoveUp database.  
Figure 2: Classes added the MoveUp UML diagram to deal with profiling.