com.eloview.homesdk.eloview

## Class EloView

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

- All Implemented Interfaces:
    java.lang.Cloneable

      public class EloView
      extends AccountManager

  EloView class provides the below operations.
  - A method to set the content that needs to be played on the device in EloView control mode when the device is is offline or not registered to an account `setOfflinePlayContent`
  - A method to get the type of content (apk/web view) and name of the content set on the device in EloView Control mode `getPlayContent`
  - A method to return the status of the current play content on the device in EloView control mode `getPlayContentStatus`
  - A method to get the current connection status of the device with EloView cloud (online/offline) `getDeviceCloudStatus`
  - A method to toggle the WiFi state in Elo QuickSettings. This method also toggles the WiFi state in Android Home Mode. `toggleWifi`
  - A method to toggle the Bluetooth in Elo QuickSettings. This method also toggles the Bluetooth state in Android Home Mode. `toggleBT`
  - A method to unregister the broadcast receiver registered while using any of the EloView APIs. Call this method in the onPause and onDestroy methods of the activity in which any of the above APIs are used. `unregisterEloViewAPIListener`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ACTION_GET_DEVICE_CLOUD_STATUS`
    `static java.lang.String` | `ACTION_GET_PLAY_CONTENT`
    `static java.lang.String` | `ACTION_GET_PLAY_CONTENT_STATUS`
    `static java.lang.String` | `ACTION_SET_OFFLINE_PLAY_CONTENT`
    `static java.lang.String` | `ACTION_STICKY_ANDROID_HOME_MODE`
    `static int` | `DEVICE_CLOUD_STATUS_CODE` Response code to get the current connection status of Device with EloView cloud
    `static int` | `GET_DEVICE_ONLINE_STATUS`
    `static int` | `GET_PLAY_CONTENT`
    `static int` | `GET_PLAY_CONTENT_STATUS`
    `static EloView` | `instance`
    `static int` | `OFFLINE_PLAY_CONTENT_CODE` Response code to get the status of the offline play content
    `static int` | `QS_BT_RESPONSE_CODE` Response code for enable/disable bt in quick settings
    `static int` | `QS_WIFI_RESPONSE_CODE` Response code for enable/disable wifi in quick settings
    `static java.lang.String` | `RESPONSE_GET_DEVICE_CLOUD_STATUS`
    `static java.lang.String` | `RESPONSE_OFFLINE_PLAY_CONTENT`
    `static int` | `SWITCH_TO_ANDROID_HOME_RESPONSE_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
    `EloView()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `getDeviceCloudStatus(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)` This method returns device's online/offline status.
    `void` | `getPlayContent(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)` This method returns the type of content and name of the content set on the device.
    `void` | `getPlayContentStatus(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)` This method returns the status of play content on the device in control mode.
    `void` | `setOfflinePlayContent(android.content.Context context, java.lang.String accessToken, java.lang.String packageName, android.os.Handler handler)` This method is used to set content on the device in EloView control mode when device is offline or not registered to an account.
    `void` | `switchToAndroidHomeMode(android.content.Context context, java.lang.String accessToken, android.os.Handler handler)` This method is used to switch to Android home mode from EloView mode.
    `void` | `toggleBT(android.content.Context context, java.lang.String accessToken, android.os.Handler handler, boolean isEnableBT)` This method is used to toggle the Bluetooth in Quicksettings (EloView mode).
    `void` | `toggleWifi(android.content.Context context, java.lang.String accessToken, android.os.Handler handler, boolean isEnableWifi)` This method is used to toggle the wifi in Quicksettings (EloView mode).
    `void` | `unregisterEloViewAPIListener(android.content.Context context)` This method is used to unregister the broadcast receiver registered while using any of the EloView APIs. Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of any of the EloView APIs.

    - ### 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

    - #### ACTION_SET_OFFLINE_PLAY_CONTENT

          public static final java.lang.String ACTION_SET_OFFLINE_PLAY_CONTENT

      See Also:
        Constant Field Values

    - #### ACTION_GET_PLAY_CONTENT

          public static final java.lang.String ACTION_GET_PLAY_CONTENT

      See Also:
        Constant Field Values

    - #### ACTION_GET_PLAY_CONTENT_STATUS

          public static final java.lang.String ACTION_GET_PLAY_CONTENT_STATUS

      See Also:
        Constant Field Values

    - #### RESPONSE_OFFLINE_PLAY_CONTENT

          public static final java.lang.String RESPONSE_OFFLINE_PLAY_CONTENT

      See Also:
        Constant Field Values

    - #### ACTION_GET_DEVICE_CLOUD_STATUS

          public static final java.lang.String ACTION_GET_DEVICE_CLOUD_STATUS

      See Also:
        Constant Field Values

    - #### RESPONSE_GET_DEVICE_CLOUD_STATUS

          public static final java.lang.String RESPONSE_GET_DEVICE_CLOUD_STATUS

      See Also:
        Constant Field Values

    - #### OFFLINE_PLAY_CONTENT_CODE

          public static final int OFFLINE_PLAY_CONTENT_CODE

      Response code to get the status of the offline play content
      See Also:
        Constant Field Values

    - #### DEVICE_CLOUD_STATUS_CODE

          public static final int DEVICE_CLOUD_STATUS_CODE

      Response code to get the current connection status of Device with EloView cloud
      See Also:
        Constant Field Values

    - #### QS_WIFI_RESPONSE_CODE

          public static final int QS_WIFI_RESPONSE_CODE

      Response code for enable/disable wifi in quick settings
      See Also:
        Constant Field Values

    - #### QS_BT_RESPONSE_CODE

          public static final int QS_BT_RESPONSE_CODE

      Response code for enable/disable bt in quick settings
      See Also:
        Constant Field Values

    - #### SWITCH_TO_ANDROID_HOME_RESPONSE_CODE

          public static final int SWITCH_TO_ANDROID_HOME_RESPONSE_CODE

      See Also:
        Constant Field Values

    - #### GET_PLAY_CONTENT

          public static final int GET_PLAY_CONTENT

      See Also:
        Constant Field Values

    - #### GET_PLAY_CONTENT_STATUS

          public static final int GET_PLAY_CONTENT_STATUS

      See Also:
        Constant Field Values

    - #### GET_DEVICE_ONLINE_STATUS

          public static final int GET_DEVICE_ONLINE_STATUS

      See Also:
        Constant Field Values

    - #### instance

          public static EloView instance

    - #### ACTION_STICKY_ANDROID_HOME_MODE

          public static final java.lang.String ACTION_STICKY_ANDROID_HOME_MODE

  - ### Constructor Detail

    - #### EloView

          public EloView()

  - ### Method Detail

    - #### setOfflinePlayContent

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

      This method is used to set content on the device in EloView control mode when device is offline or not registered to an account. If the device comes online and content is set through EloView, it will override the content set through this API.
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - online token or offline JWT Token
        `packageName` - Package to be set as default content on the device.
        `handler` - A handler to receive one of the following callback messages:

        `OFFLINE_PLAY_CONTENT_CODE`
        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`

    - #### getPlayContent

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

      This method returns the type of content and name of the content set on the device. This method works only in EloView control mode.
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - online token or offline JWT Token
        `handler` - A handler to receive one of the following callback messages:

        `OFFLINE_PLAY_CONTENT_CODE`
        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`

    - #### getPlayContentStatus

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

      This method returns the status of play content on the device in control mode. The status can be one of the following strings. YET_TO_DOWNLOAD DOWNLOADING DOWNLOADED INSTALLING INSTALLED DOWNLOAD_FAILED INSTALL_FAILED UNKNOWN_STATUS
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - online token or offline JWT Token
        `handler` - A handler to receive one of the following callback messages:

        `OFFLINE_PLAY_CONTENT_CODE`
        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`

    - #### unregisterEloViewAPIListener

          public void unregisterEloViewAPIListener(android.content.Context context)

      This method is used to unregister the broadcast receiver registered while using any of the EloView APIs.
      Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of any of the EloView APIs. This ensures the receiver is not leaked.
      Parameters:
        `context` - Context in which the system APIs were used

    - #### getDeviceCloudStatus

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

      This method returns device's online/offline status. The status can be one of the following strings. "Online " "Offline " "Connecting " "Reconnecting " "Online ( Not Provisioned )
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - online token or offline JWT Token
        `handler` - A handler to receive one of the following callback messages:

        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`

    - #### toggleWifi

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

      This method is used to toggle the wifi in Quicksettings (EloView mode). It can also be used to toggle Wifi in Android Home mode.
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - Offline Token
        `handler` - A handler to receive one of the following callback messages:

        `QS_WIFI_RESPONSE_CODE`
        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`

    - #### switchToAndroidHomeMode

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

      This method is used to switch to Android home mode from EloView mode. There is no way to switch back to EloView mode without a factory reset so use with caution.
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - An offline JWT token.
        `handler` - A handler to receive one of the following callback messages:

        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`
        `SWITCH_TO_ANDROID_HOME_RESPONSE_CODE`

    - #### toggleBT

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

      This method is used to toggle the Bluetooth in Quicksettings (EloView mode). It can also be used to toggle the Bluetooth in Android Home mode.
      Parameters:
        `context` - A context object of the calling Class (Activity/Service).
        `accessToken` - Offline Token
        `handler` - A handler to receive one of the following callback messages:

        `QS_WIFI_RESPONSE_CODE`
        `AccountManager.TOKEN_VERIFY_FAIL`
        `Consts.GENERIC_ERROR`