Package 

Class MainViewModel


  • 
    public class MainViewModel
    extends AndroidViewModel
                        

    ViewModel class for managing UI-related data in a lifecycle-conscious way. This ViewModel handles data operations related to the Sensfrx SDK.

    • Constructor Summary

      Constructors 
      Constructor Description
      MainViewModel(Application application) Constructs a new MainViewModel with the given application context.
    • Method Summary

      Modifier and Type Method Description
      MutableLiveData<DeviceInfoResponse> sendDeviceInformationToServer(JsonObject deviceFingerprintObject) Sends device information to the server using the repository.
      MutableLiveData<JsonObject> pushEvents(JsonObject event) Pushes event logs to the server using the repository.
      MutableLiveData<JsonObject> pushTransaction(JsonObject transactionJson) Notifies the Sensfrx server of a transaction.
      • Methods inherited from class androidx.lifecycle.AndroidViewModel

        getApplication
      • Methods inherited from class androidx.lifecycle.ViewModel

        addCloseable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MainViewModel

        MainViewModel(Application application)
        Constructs a new MainViewModel with the given application context.
        Parameters:
        application - The application context used for initializing the repository.
    • Method Detail

      • pushEvents

         MutableLiveData<JsonObject> pushEvents(JsonObject event)

        Pushes event logs to the server using the repository.

        Parameters:
        event - A JsonObject containing event data.
      • pushTransaction

         MutableLiveData<JsonObject> pushTransaction(JsonObject transactionJson)

        Notifies the Sensfrx server of a transaction.

        Parameters:
        transactionJson - A JsonObject containing transaction data.