• Non ci sono risultati.

The Android Application

4.5 The Data Registration Activity

This is the activity devoted to patient-to-physician communication. From this screen, the patient chooses which kind of data to save on the Firebase Database, by clicking on the related button (Figure 4.11).

"Pressione Sanguigna" stands for Blood Pressure, "Peso" stands for Weight,

"Sigarette Fumate" stands for Smoked Cigarettes, "Attività Fisica" stands for Phys-ical Activity, "Frequenza Cardica" stands for Heart Rate, "Glicemia" stands for Glycaemia, "Evento" stands for Event.

Figure 4.11: The Data Registration Activity

Each button opens a specific dialogue box, devoted to the communication of that specific kind of data, except for the Event Button, that opens a dedicated activity. When a dialogue has been opened, it cannot be closed by clicking outside it on the screen, but it can be closed only by completing the operation, by clicking Ok, or by deleting it, by clicking Delete ("Annulla"). Again, a few adjustments have been implemented to avoid user mistakes.

First, by clicking on the input box of a numerical data, only the numerical keypad is accessible and no other characters are permitted. Moreover, in case of values that have to be integer, also the decimal point is disabled.

Figure 4.12:

Pressure Dialogue Figure 4.13:

Pressure Dialogue Empty Field Error

Figure 4.14:

Pressure Dialogue Wrong Value Error

Pressure Dialogue in Figure 4.12 is used as example to explain the other two adjustments. In the dialogue box, "Inserisci la tua pressione" means Insert your pressure values, while "Minima" and "Massima" respectively stand for Minimum (Diastolic) and Maximum (Systolic).

The second implemented adjustment avoids to insert empty data: data regis-tration is blocked if a requested field is not filled (Figure 4.13).

Third, a control function avoids the user to insert values completely off the scale, that would be nonsense data (Figure 4.14).

In all these cases, the error field is focused and a Toast message is displayed.

Weight Dialogue is structured in the same way, the only exceptions are that has only one field to be compiled and that the decimal point is accepted (Figure 4.15).

In the form, "Inserisci il tuo peso" stands for Insert your weight.

Figure 4.15:

Weight Dialogue Figure 4.16:

Smoke Dialogue

The Smoke Dialogue instead is quite different. It is composed by a single radio button, where the patient can tell if he smoked or not in the considered day (Figure 4.16). In the dialogue box, "Hai fumato oggi?" stands for Have you smoked today?, while "Si" and "No" mean respectively Yes and No.

As in the other two dialogues, the user can close it only by responding or clicking the cancel button. This choice has been made to avoid the user to confirm without giving that piece of information, maybe convinced otherwise.

The fourth button opens the Physical Activity Dialogue. This allows the pa-tient to communicate how much time in minutes he/she spends each day doing some physical activities, divided in four categories: Walking ("Camminata"), Run-ning ("Corsa"), Biking ("Bicicletta") and Gym ("Palestra") (Figure 4.17). "Attività Fisica" stands for Physical Activity, while "Minuti" stands for Minutes.

Figure 4.17: Physical Activity Dialogue

In this case the dialogue box behaves slightly differently. In fact, this is the only box allowing to have some field not filled in: if none is filled, the application behaves normally, advising the user in the ordinary way, but it accepts the confirmation if at least a single field is compiled. This because it is normal for a person to do different kinds of physical activity maybe in different days, or in different moments of the day. So the patient can fill each input box when and as he/she wants.

The last dialogues opened by this activity are the Heart Rate Dialogue (Figure 4.18) and the Glycaemia Dialogue (Figure 4.19). Those dialogue boxes follow the same rules of the Weight Dialogue, but the first accepts only integer numbers as input.

Figure 4.18:

Heart Rate Dialogue

Figure 4.19:

Glycaemia Dialogue

All those dialogues, when the OK button is pressed, publish the inserted data into the Firebase Database. If no other action is performed by the patient, data are published referring the current day, but the user is allowed to insert data also related to previous days. This activity presents a three dots menu on the top right of the view, from which it is possible to change the considered date (Figure 4.20).

Figure 4.20:

Three Dots Menu [31]

Figure 4.21:

Date Picker

By clicking on the Choose Date ("Scegli la data") menu item, an Android Date Picker is opened on the screen (Figure 4.21).

At its opening, the date picker is always set on the current date. From this box the patient can choose a different date to insert his/her data. Any past date is accepted, but when the user opens a dialogue box, a message is shown to remem-ber that he/she is modifying a past information (Figure 4.22). This because the user could still make some mistakes in inserting his/her data, or not having the possibility to do that or forget it. The message in red says: "Attention! You are modifying a past information!".

Figure 4.22: Pressure Dialogue Box for a Past Date

When the user presses OK from the Date Picker, it is closed and the title of the Data Registration activity changes from Filo - Today to Filo - chosen date"

(Figure 4.23).

Figure 4.23:

Data Registration Activity for a Past Date

Figure 4.24:

Future Date Toast Message

As for all the other parts of the application, some adjustments have been taken also for the Date Picker. If the user selects a future date to insert the data, the application rejects this choice, setting the date to the current day, also changing the title to Filo - Today, and displaying a Toast message advising the user that he/she cannot choose a future date (Figure 4.24). The Toast message says: "You cannot insert data for a future date".

The last button, the Event button, opens the Event Registration Activity, discussed in section 4.6.

Documenti correlati