Class SystemParameterHelper


  • public final class SystemParameterHelper
    extends java.lang.Object
    Helper to retrieve Android system configuration.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getAppVersion​(android.content.Context applicationContext)
      Return the current version of the application.
      static java.lang.Integer getAppVersionCode​(android.content.Context applicationContext)
      Return the current version code of the application.
      static java.lang.String getBridgeVersion()
      Get the version of the Bridge currently using Batch if available
      static java.lang.String getBundleName​(android.content.Context applicationContext)
      Return the bundle name of the application.
      static java.lang.String getDeviceBrand()
      Return the Brand name of the device
      static java.lang.String getDeviceCountry()
      Get the current device country
      static java.lang.String getDeviceDate()
      Return the device date formatted with RFC 3339 format
      static java.lang.String getDeviceLanguage()
      Get the current device language
      static java.lang.String getDeviceModel()
      Return the device model of the phone.
      static java.lang.String getDeviceTimezone()
      Get the current device timezone.
      static java.lang.Long getFirstInstallDate​(android.content.Context applicationContext)
      Get very first installation date.
      static java.lang.Long getLastUpdateDate​(android.content.Context applicationContext)
      Get last update date.
      static java.lang.String getNetworkCountryIso​(android.content.Context applicationContext)
      Get the network ISO country code.
      static java.lang.Integer getNetworkKind​(android.content.Context context)
      Return the connected network kind
      static java.lang.String getNetworkOperatorName​(android.content.Context applicationContext)
      Get the mobile network name.
      static java.lang.String getOSVersion()
      Return the version of Android of the phone.
      static java.lang.String getPluginVersion()
      Get the version of the Plugin currently using Batch if available
      static int getScreenHeight​(android.content.Context context)
      Get the screen height
      static int getScreenOrientation​(android.content.Context context)
      Return the current display orientation ( http://stackoverflow.com/a/4698003 )
      static int getScreenWidth​(android.content.Context context)
      Get screen width
      static java.lang.String getSimCountryIso​(android.content.Context applicationContext)
      Get the operator ISO country code.
      static java.lang.String getSimOperator​(android.content.Context applicationContext)
      Get the operator MCC+MNC (Mobile Country Code + Mobile Network Code)
      static java.lang.String getSimOperatorName​(android.content.Context applicationContext)
      Get the telephony operator name.
      static java.lang.String getValue​(java.lang.String shortName, android.content.Context context)
      Get property data from it's short parameter name.
      static java.lang.Boolean isNetRoaming​(android.content.Context applicationContext)
      Tell whether the network is in roaming mode.
      • Methods inherited from class java.lang.Object

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

      • SystemParameterHelper

        public SystemParameterHelper()
    • Method Detail

      • getBundleName

        public static java.lang.String getBundleName​(android.content.Context applicationContext)
        Return the bundle name of the application.
        Parameters:
        applicationContext - The application context.
        Returns:
        The application bundle name.
      • getDeviceTimezone

        public static java.lang.String getDeviceTimezone()
        Get the current device timezone.
        Returns:
        timezone or null on failure.
      • getDeviceLanguage

        public static java.lang.String getDeviceLanguage()
        Get the current device language
        Returns:
        language
      • getDeviceCountry

        public static java.lang.String getDeviceCountry()
        Get the current device country
        Returns:
        country
      • getDeviceDate

        public static java.lang.String getDeviceDate()
        Return the device date formatted with RFC 3339 format
        Returns:
      • getFirstInstallDate

        public static java.lang.Long getFirstInstallDate​(android.content.Context applicationContext)
        Get very first installation date.
        Parameters:
        applicationContext - The application context.
        Returns:
        Installation date or null on failure.
      • getLastUpdateDate

        public static java.lang.Long getLastUpdateDate​(android.content.Context applicationContext)
        Get last update date.
        Parameters:
        applicationContext - The application context.
        Returns:
        Last update date or null on failure.
      • getDeviceBrand

        public static java.lang.String getDeviceBrand()
        Return the Brand name of the device
        Returns:
        Brand name if found, null otherwise
      • getDeviceModel

        public static java.lang.String getDeviceModel()
        Return the device model of the phone.
        Returns:
        The device model if found, null otherwise.
      • getAppVersion

        public static java.lang.String getAppVersion​(android.content.Context applicationContext)
        Return the current version of the application.
        Parameters:
        applicationContext - The application context.
        Returns:
        AppVersion if found, null otherwise
      • getAppVersionCode

        public static java.lang.Integer getAppVersionCode​(android.content.Context applicationContext)
        Return the current version code of the application.
        Parameters:
        applicationContext - The application context.
        Returns:
        AppVersion code if found, null otherwise
      • getOSVersion

        public static java.lang.String getOSVersion()
        Return the version of Android of the phone.
        Returns:
        Version.
      • getSimOperatorName

        public static java.lang.String getSimOperatorName​(android.content.Context applicationContext)
        Get the telephony operator name.
        Parameters:
        applicationContext - The application context.
        Returns:
        Operator name or null.
      • getSimOperator

        public static java.lang.String getSimOperator​(android.content.Context applicationContext)
        Get the operator MCC+MNC (Mobile Country Code + Mobile Network Code)
        Parameters:
        applicationContext - The application context.
        Returns:
        The Mobile code or null.
      • getSimCountryIso

        public static java.lang.String getSimCountryIso​(android.content.Context applicationContext)
        Get the operator ISO country code.
        Parameters:
        applicationContext - The application context.
        Returns:
        The country code of null.
      • getNetworkOperatorName

        public static java.lang.String getNetworkOperatorName​(android.content.Context applicationContext)
        Get the mobile network name.
        Parameters:
        applicationContext - The application context.
        Returns:
        Network name or null.
      • getNetworkCountryIso

        public static java.lang.String getNetworkCountryIso​(android.content.Context applicationContext)
        Get the network ISO country code.
        Parameters:
        applicationContext - The application context.
        Returns:
        Network country core or null.
      • isNetRoaming

        public static java.lang.Boolean isNetRoaming​(android.content.Context applicationContext)
        Tell whether the network is in roaming mode.
        Parameters:
        applicationContext - The application context.
        Returns:
        true/false, null on failure.
      • getBridgeVersion

        public static java.lang.String getBridgeVersion()
        Get the version of the Bridge currently using Batch if available
        Returns:
        Bridge version string
      • getPluginVersion

        public static java.lang.String getPluginVersion()
        Get the version of the Plugin currently using Batch if available
        Returns:
        Plugin version string
      • getScreenHeight

        public static int getScreenHeight​(android.content.Context context)
        Get the screen height
        Parameters:
        context -
        Returns:
        height if found, 0 on error
      • getScreenWidth

        public static int getScreenWidth​(android.content.Context context)
        Get screen width
        Parameters:
        context -
        Returns:
        width if found, 0 on error
      • getScreenOrientation

        public static int getScreenOrientation​(android.content.Context context)
        Return the current display orientation ( http://stackoverflow.com/a/4698003 )
        Parameters:
        context -
        Returns:
        Configuration.ORIENTATION_LANDSCAPE or Configuration.ORIENTATION_PORTRAIT. Configuration.ORIENTATION_UNDEFINED on error
      • getNetworkKind

        public static java.lang.Integer getNetworkKind​(android.content.Context context)
        Return the connected network kind
        Parameters:
        context -
        Returns:
        null if unknown (usually means that ACCESS_NETWORK_STATE isn't granted), 1 for wifi/ethernet/dummy, 0 for everything else.
      • getValue

        public static java.lang.String getValue​(java.lang.String shortName,
                                                android.content.Context context)
        Get property data from it's short parameter name.
        Parameters:
        shortName -
        Returns: