# init

Source: [https://docs.qualcomm.com/doc/80-PK177-134/topic/java_init.html](https://docs.qualcomm.com/doc/80-PK177-134/topic/java_init.html)

Initializes a QESDK session with a user-given license key. Applications can initialize
    and de-initialize all services in single call.

init()Copy to clipboard

Init supports either direct license information as a parameter or embedded as an asset of the
      APK with a directory and filename convention. If you use the embedded form, then the license
      file, license.qti is placed in the Assets folder of the APK under a license directory.

It triggers an authentication call to QESDK and returns a status for success or failure code
      if the authentication is unsuccessful.

Note: Maximum 5 invalid license attempts are allowed in an instance of the APP. If
      an application tries to initialize with invalid license for 5 times, then further requests
      will fail; irrespective of a valid license.

Call this API only once per session.

## Parameters

| Parameter | Data type | Description |
| --- | --- | --- |
| license | String | Optional parameter; contains the license string |
| cb | IQesdkEventCallBack | Callback used to inform the application of a subsystem disconnection; see [IQesdkEventCallBack](https://docs.qualcomm.com/doc/80-PK177-134/topic/java_iqesdk_event_callback.html). |

## Returns

| Return | Description |
| --- | --- |
| int | Status with a positive value that is, 0 or above is success and below 0 is an<br>                error. The following are the possible return values:<ul class="ul" id="init_8__ul_agx_q5t_zxb_spyrz_07-03-23-1126-15-608"><br>                  <li class="li">≥ 0: Valid session </li><br><br>                  <li class="li">-1: License file not found</li><br><br>                  <li class="li">-2: Invalid license</li><br><br>                  <li class="li">-3: Feature ID not supported</li><br><br>                  <li class="li">-4: QESDK transport error</li><br><br>                </ul> |

**Parent Topic:** [QESDK specific APIs](https://docs.qualcomm.com/doc/80-PK177-134/topic/qesdk_specific_apis.html)

Last Published: Nov 14, 2024

[Previous Topic
Constructor](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/java_creator.md) [Next Topic
deinit](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/java_deinit.md)