Package 

Class Utils


  • 
    public class Utils
    
                        

    Utility class that provides various helper methods used throughout the application.

    • Method Summary

      Modifier and Type Method Description
      static Gson getGsonInstance() Returns a singleton instance of Gson configured with custom adapters for Event-related classes.
      static int calculateCpuUsagePercentage(int toCalculate, int maximum) Calculates CPU usage as a percentage.
      static boolean isNetworkAvailable(Context context) Checks if the device is connected to a network.
      static String getTimestamp() Returns the current timestamp in ISO 8601 format.
      • Methods inherited from class java.lang.Object

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

      • getGsonInstance

         static Gson getGsonInstance()

        Returns a singleton instance of Gson configured with custom adapters for Event-related classes.

      • calculateCpuUsagePercentage

         static int calculateCpuUsagePercentage(int toCalculate, int maximum)

        Calculates CPU usage as a percentage.

        Parameters:
        toCalculate - The value to calculate.
        maximum - The maximum value for the calculation.
      • isNetworkAvailable

         static boolean isNetworkAvailable(Context context)

        Checks if the device is connected to a network.

        Parameters:
        context - The application context.
      • getTimestamp

         static String getTimestamp()

        Returns the current timestamp in ISO 8601 format.