Package com.batch.android.core
Class SystemParameterHelper
- java.lang.Object
-
- com.batch.android.core.SystemParameterHelper
-
public final class SystemParameterHelper extends java.lang.ObjectHelper to retrieve Android system configuration.
-
-
Constructor Summary
Constructors Constructor Description SystemParameterHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetAppVersion(android.content.Context applicationContext)Return the current version of the application.static java.lang.IntegergetAppVersionCode(android.content.Context applicationContext)Return the current version code of the application.static java.lang.StringgetBridgeVersion()Get the version of the Bridge currently using Batch if availablestatic java.lang.StringgetBundleName(android.content.Context applicationContext)Return the bundle name of the application.static java.lang.StringgetDeviceBrand()Return the Brand name of the devicestatic java.lang.StringgetDeviceCountry()Get the current device countrystatic java.lang.StringgetDeviceDate()Return the device date formatted with RFC 3339 formatstatic java.lang.StringgetDeviceLanguage()Get the current device languagestatic java.lang.StringgetDeviceModel()Return the device model of the phone.static java.lang.StringgetDeviceTimezone()Get the current device timezone.static java.lang.LonggetFirstInstallDate(android.content.Context applicationContext)Get very first installation date.static java.lang.LonggetLastUpdateDate(android.content.Context applicationContext)Get last update date.static java.lang.StringgetNetworkCountryIso(android.content.Context applicationContext)Get the network ISO country code.static java.lang.IntegergetNetworkKind(android.content.Context context)Return the connected network kindstatic java.lang.StringgetNetworkOperatorName(android.content.Context applicationContext)Get the mobile network name.static java.lang.StringgetOSVersion()Return the version of Android of the phone.static java.lang.StringgetPluginVersion()Get the version of the Plugin currently using Batch if availablestatic intgetScreenHeight(android.content.Context context)Get the screen heightstatic intgetScreenOrientation(android.content.Context context)Return the current display orientation ( http://stackoverflow.com/a/4698003 )static intgetScreenWidth(android.content.Context context)Get screen widthstatic java.lang.StringgetSimCountryIso(android.content.Context applicationContext)Get the operator ISO country code.static java.lang.StringgetSimOperator(android.content.Context applicationContext)Get the operator MCC+MNC (Mobile Country Code + Mobile Network Code)static java.lang.StringgetSimOperatorName(android.content.Context applicationContext)Get the telephony operator name.static java.lang.StringgetValue(java.lang.String shortName, android.content.Context context)Get property data from it's short parameter name.static java.lang.BooleanisNetRoaming(android.content.Context applicationContext)Tell whether the network is in roaming mode.
-
-
-
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_LANDSCAPEorConfiguration.ORIENTATION_PORTRAIT.Configuration.ORIENTATION_UNDEFINEDon 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:
-
-