StudyUserDataViewModel

class StudyUserDataViewModel(application: Application) : AndroidViewModel

Stores all data collected in the study and includes functionality to send the data.

Stores the time the user needs to complete the registration and login process and the personal data the user provided for the study. Once the study is finished the data will be sent to an PHP script which is connected to an MySQL database to store the data permanently.

Constructors

StudyUserDataViewModel
Link copied to clipboard
fun StudyUserDataViewModel(application: Application)

Types

Companion
Link copied to clipboard
object Companion

Properties

_age
Link copied to clipboard
private var _age: MutableLiveData<Int?>
Represents the age of the user.
_gender
Link copied to clipboard
private var _gender: MutableLiveData<Int>
Represents the gender of the user.
_sendingStudyData
Link copied to clipboard
private var _sendingStudyData: MutableLiveData<Boolean>
Is true while data are being sent to MySQL Database via PHP script.
_sentStudyData
Link copied to clipboard
private var _sentStudyData: MutableLiveData<Boolean>
Is true if all study data has been sent successfully.
_technicalExperienceFrequency
Link copied to clipboard
private var _technicalExperienceFrequency: MutableLiveData<Int>
Represents usage frequency of smartphones by the user.
_technicalExperienceVariety
Link copied to clipboard
private var _technicalExperienceVariety: MutableLiveData<Int>
Represents usage frequency of technical devices of the user.
age
Link copied to clipboard
val age: LiveData<Int?>
client
Link copied to clipboard
private val client: OkHttpClient
HTTP client.
gender
Link copied to clipboard
val gender: LiveData<Int>
sendingStudyData
Link copied to clipboard
val sendingStudyData: LiveData<Boolean>
sentStudyData
Link copied to clipboard
val sentStudyData: LiveData<Boolean>
technicalExperienceFrequency
Link copied to clipboard
val technicalExperienceFrequency: LiveData<Int>
technicalExperienceVariety
Link copied to clipboard
val technicalExperienceVariety: LiveData<Int>
userFinishedTime
Link copied to clipboard
var userFinishedTime: Long? = null
Stores the system time when login process was completed successfully.
userLoginStartTime
Link copied to clipboard
var userLoginStartTime: Long? = null
Stores system time when FIDO2 for Android API Intent for login with key is called.
userLoginTime
Link copied to clipboard
var userLoginTime: Long = 0
Stores difference between userFinishedTime and userLoginStartTime
userLoginTimeInSeconds
Link copied to clipboard
var userLoginTimeInSeconds: Double = 0.0
Stores userLoginTime in seconds.
userRegisterFinishedTime
Link copied to clipboard
var userRegisterFinishedTime: Long? = null
Stores system time when FIDO2 for Android API Intent for registering key was completed successfully.
userRegisterStartTime
Link copied to clipboard
var userRegisterStartTime: Long? = null
Stores system time when FIDO2 for Android API Intent for registering key is called.
userRegisterTime
Link copied to clipboard
var userRegisterTime: Long = 0
Stores difference between userRegisterFinishedTime and userRegisterStartTime
userRegisterTimeInSeconds
Link copied to clipboard
var userRegisterTimeInSeconds: Double = 0.0
Stores userRegisterTime in seconds.
userStartTime
Link copied to clipboard
var userStartTime: Long? = null
Stores the system start time of the study.
userTime
Link copied to clipboard
var userTime: Long = 0
Stores the difference between userFinishedTime and userStartTime.
userTimeInSeconds
Link copied to clipboard
var userTimeInSeconds: Double = 0.0
Stores userTime converted from nanoseconds into seconds.

Inherited properties

mApplication
Link copied to clipboard
private val mApplication: Application
mBagOfTags
Link copied to clipboard
private val mBagOfTags: MutableMap<String, Any>?
mCleared
Link copied to clipboard
private val mCleared: Boolean

Functions

calculateUserTime
Link copied to clipboard
fun calculateUserTime()
Calculate time differences between finished and start times and convert results into seconds.
convertNanoToSec
Link copied to clipboard
private fun convertNanoToSec(time: Long): Double
Convert given time from nanoseconds to seconds.
sendData
Link copied to clipboard
fun sendData()
Implements functionality to send user study data to Database.
setAge
Link copied to clipboard
fun setAge(ageInput: Int?)
setGender
Link copied to clipboard
fun setGender(genderInput: Int)
Sets the gender specified by the user immediately when user selects it from radio group in UserDataFragment.
setTechnicalExperienceFrequency
Link copied to clipboard
fun setTechnicalExperienceFrequency(technicalExperienceInput: Int)
Sets the usage frequency of technical devices specified by the user immediately when user selects it from radio group in UserDataFragment.
setTechnicalExperienceVariety
Link copied to clipboard
fun setTechnicalExperienceVariety(technicalExperienceInput: Int)

Inherited functions

clear
Link copied to clipboard
fun clear()
getApplication
Link copied to clipboard
open fun <T : Application> getApplication(): T
getTag
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
onCleared
Link copied to clipboard
open fun onCleared()
setTagIfAbsent
Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T