com.eloview.homesdk.infoManager

## Class Info

- java.lang.Object
- - com.eloview.homesdk.consts.Consts
  - - com.eloview.homesdk.accountManager.AccountManager
    - - com.eloview.homesdk.infoManager.Info

- All Implemented Interfaces:
    java.lang.Cloneable

      public class Info
      extends AccountManager

  Info class provides device related information. It provides the below operations:
  - A method to get the device information `getDeviceInfo`
    - If the device is in Android home mode this method gives information such as the device MODEL, SERIAL, PRODUCT, DEVICE, MANUFACTURER, BOARD, BRAND, ID, and DISPLAY information in json format
    - If the device is in EloView mode, registered to an EloView account and Online, we can also get information such as parent_account", "state_province", "site_name", "device_name", "address_line_1", "postal_code", "country", "city", "group_name"
  - A method to register a broadcast receiver that receives any change in device info from EloView `registerDeviceInfoReceiver`
  - A method to unregister the broadcast receiver that receives any change in device info from EloView `unregisterDeviceInfoReceiver`
  - A method to get the SDK version number using `getSDKVersion`
  - A method to Check whether the SDK is supported or not on the current device using `isSDKSupported`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ACTION_GET_DEVICE_PROPERTIES`
    `static java.lang.String` | `ACTION_GET_SERIAL_NO`
    `static int` | `DEVICE_INFO_CODE`
    `static Info` | `instance`
    `static int` | `REGISTER_CTX_NULL_CODE`
    `static int` | `REGISTERED_EXCEPTION_CODE`
    `static int` | `REGISTERED_SUCCESSFULLY_CODE`
    `static int` | `UNREGISTER_CTX_NULL_CODE`
    `static int` | `UNREGISTERED_EXCEPTION_CODE`
    `static int` | `UNREGISTERED_SUCCESSFULLY_CODE`

    - ### Fields inherited from class com.eloview.homesdk.accountManager.AccountManager

      `ACCESS_TOKEN_INVALID, ACCESS_TOKEN_VALID, API_ACCESS_TOKEN_INVALID, API_ACCESS_TOKEN_VALID, IS_USER_LOGIN_OAUTH, isPolaris, KEY_SERVER_ELO_POLARIS_DEV, KEY_SERVER_PRODUCTION_POLARIS, KEY_SERVER_QA_POLARIS, KEY_SERVER_STAGING_POLARIS, OAUTH_TOKEN_INVALID, OAUTH_TOKEN_VALID, REQUEST_AUTH_LOGIN, REQUEST_AUTH_LOGOUT, SETUP_OAUTH_ERROR, SETUP_OAUTH_SUCCESS, TOKEN_VERIFY_FAIL, TOKEN_VERIFY_SUCCESS`

    - ### Fields inherited from class com.eloview.homesdk.consts.Consts

      `ACTION_SET_EST_REQUEST, ELO_FOLDER, ELO_NETWORK_CONF_CSV_FILE, ELO_WIFI_CONFIG_FOLDER, GENERIC_ERROR, isFROM, OAUTH_PATH_TOKEN, OAUTH_PATH_VERIFY, REQUEST_TOKEN, STR_CUSTOM_ANIM_IMAGE_FILE, STR_CUSTOM_ANIM_VIDEO_FILE, STR_CUSTOM_BRAND_LOGO_FILE, STR_CUSTOM_BRAND_NAME_FILE, STR_CUSTOM_BRAND_POWERED_BY_LOGO_FILE, STR_CUSTOM_LOCALE_NAME_FILE, STR_CUSTOM_WALLPAPER, STR_ELO_PATH_FOR_CUSTOM_ANIMATION, STR_SDCARD_ELO_DIR_PATH, VERIFY_TOKEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Info()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `getDeviceInfo(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)` This method provides the device related information such as the device MODEL, SERIAL, PRODUCT, DEVICE, MANUFACTURER, BOARD, BRAND, ID, and DISPLAY information in json format If the device is registered on Eloview and was online at least once, then this method also provides details such as "parent_account", "state_province", "site_name", "device_name", "address_line_1", "postal_code", "country", "city", "group_name".
    `static java.lang.String` | `getJSONStringValue(java.lang.String jsonString, java.lang.String key)`
    `java.lang.String` | `getSDKVersion(android.content.Context context)` This method is used to get the current version number of the EloView Home SDK.
    `static boolean` | `isPackageInstalled(android.content.Context context, java.lang.String pkgName)` This method used to identify package is installed or not.
    `boolean` | `isSDKSupported(android.content.Context context)` This method is used to check if the SDK is supported on the current device.
    `int` | `registerDeviceInfoReceiver(android.content.Context ctx, android.content.BroadcastReceiver deviceInfoReceiver)` This method is used to notify any change in device info from EloView.
    `int` | `unregisterDeviceInfoReceiver(android.content.Context ctx, android.content.BroadcastReceiver deviceInfoReceiver)` This method is used to unregister the EloView device info change listener.

    - ### Methods inherited from class com.eloview.homesdk.accountManager.AccountManager

      `configureOAuthHostedUI, destroyOAuth, getBaseUri, getClientId, getEloAccessToken, getEloOAuthToken, getEnvironment, getProperty, isPolaris, isPolarisLocked, logoutOAuth, onOAuthActivityResult, selectEnvironment, setDefaultEnvironment, setProperty, stopOAuth, unregisterAccountManagerListener, verifyEloToken`

    - ### Methods inherited from class com.eloview.homesdk.consts.Consts

      `clone, getEloIntentWithFlag, getMigrate, isDevice7Inch, isDeviceM100`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEVICE_INFO_CODE

          public static final int DEVICE_INFO_CODE

      See Also:
        Constant Field Values

    - #### ACTION_GET_SERIAL_NO

          public static final java.lang.String ACTION_GET_SERIAL_NO

    - #### ACTION_GET_DEVICE_PROPERTIES

          public static final java.lang.String ACTION_GET_DEVICE_PROPERTIES

    - #### UNREGISTERED_SUCCESSFULLY_CODE

          public static final int UNREGISTERED_SUCCESSFULLY_CODE

      See Also:
        Constant Field Values

    - #### UNREGISTER_CTX_NULL_CODE

          public static final int UNREGISTER_CTX_NULL_CODE

      See Also:
        Constant Field Values

    - #### UNREGISTERED_EXCEPTION_CODE

          public static final int UNREGISTERED_EXCEPTION_CODE

      See Also:
        Constant Field Values

    - #### REGISTERED_SUCCESSFULLY_CODE

          public static final int REGISTERED_SUCCESSFULLY_CODE

      See Also:
        Constant Field Values

    - #### REGISTER_CTX_NULL_CODE

          public static final int REGISTER_CTX_NULL_CODE

      See Also:
        Constant Field Values

    - #### REGISTERED_EXCEPTION_CODE

          public static final int REGISTERED_EXCEPTION_CODE

      See Also:
        Constant Field Values

    - #### instance

          public static Info instance

  - ### Constructor Detail

    - #### Info

          public Info()

  - ### Method Detail

    - #### getJSONStringValue

          public static java.lang.String getJSONStringValue(java.lang.String jsonString,
                                                            java.lang.String key)

    - #### isPackageInstalled

          public static boolean isPackageInstalled(android.content.Context context,
                                                   java.lang.String pkgName)

      This method used to identify package is installed or not.
      Parameters:
        `context` - Context
        `pkgName` - PackageName
      Returns:
        true if the package is installed else false.

    - #### getSDKVersion

          public java.lang.String getSDKVersion(android.content.Context context)

      This method is used to get the current version number of the EloView Home SDK.
      Parameters:
        `context` - Context
      Returns:
        SDK Version in string format

    - #### isSDKSupported

          public boolean isSDKSupported(android.content.Context context)

      This method is used to check if the SDK is supported on the current device.
      Parameters:
        `context` - Context
      Returns:
        true if available false if not available

    - #### getDeviceInfo

          public void getDeviceInfo(android.content.Context context,
                                    java.lang.String accessToken,
                                    android.os.Handler handler)

      This method provides the device related information such as the device MODEL, SERIAL, PRODUCT, DEVICE, MANUFACTURER, BOARD, BRAND, ID, and DISPLAY information in json format If the device is registered on Eloview and was online at least once, then this method also provides details such as "parent_account", "state_province", "site_name", "device_name", "address_line_1", "postal_code", "country", "city", "group_name".
      Parameters:
        `context` - Context
        `accessToken` - An authentication token received from the Elo servers.
        `handler` - A handler to receive one or more of the following callback messages:

        `AccountManager.TOKEN_VERIFY_FAIL`
        `DEVICE_INFO_CODE`
        `Consts.GENERIC_ERROR`

    - #### registerDeviceInfoReceiver

          public int registerDeviceInfoReceiver(android.content.Context ctx,
                                                android.content.BroadcastReceiver deviceInfoReceiver)

      This method is used to notify any change in device info from EloView. This method works only in EloView mode and will fail to register receiver and return false in Android home mode.
      Parameters:
        `ctx` - it must be Activity or Application context
        `deviceInfoReceiver` - it must be BroadcastReceiver and it will return device info parameters in key/val pair format
      Returns:
        REGISTERED_SUCCESSFULLY_CODE if receiver successfully registered else REGISTERED_EXCEPTION_CODE

    - #### unregisterDeviceInfoReceiver

          public int unregisterDeviceInfoReceiver(android.content.Context ctx,
                                                  android.content.BroadcastReceiver deviceInfoReceiver)

      This method is used to unregister the EloView device info change listener. This method works only in EloView mode and will fail to unregister receiver and return UNREGISTERED_EXCEPTION_CODE in Android home mode.
      Parameters:
        `ctx` - it must be Activity or Application context
        `deviceInfoReceiver` - it must be BroadcastReceiver that is registered
      Returns:
        UNREGISTERED_SUCCESSFULLY_CODE -if receiver successfully unregistered -if device is not connected to eloview mode UNREGISTERED_EXCEPTION_CODE - if context or deviceInfoReceiver is null