# Install App

After initializing the DTIS SDK, use the `install()` method to specify the target app you want to download. You can specify the target app by its unique package name or its APK file URI.

{% code title="Kotlin" %}

```kotlin
fun install(
  data: String, 
  callback: IResponseCallback<InstallationResponse, Error, InstallationProgress>? = null, 
  metadata: Bundle = Bundle(), 
  action: Bundle = Bundle(), 
  config: RequestConfig = RequestConfig()
)
```

{% endcode %}

## &#x20;Parameters

| PARAMETER  | STATUS   | TYPE      | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`     | Required | String    | Package name or URI of the app.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `callback` | Optional | Interface | <p>The DTIS SDK includes the <code>IResponseCallback</code> interface for you to receive asynchronous status and progress updates throughout the installation lifecycle. You can receive installation progress by callbacks along with notifications by broadcasts.</p><p></p><p>If you do not wish to receive installation status notifications via callback, set this parameter to null.</p><p></p><p>For more information, see <a href="/pages/ToFeh1vIUT10OpGAhNKp#callback">Notifications by Callback</a>.</p>                                                                                                                                                                                                                 |
| `metadata` | Optional | Bundle    | <p>Bundled data for further processing. Use this field to send the following information about the installation:</p><p></p><ul><li>Data for direct app attribution. For more information, see <a href="/pages/IMo5BjAh7YLJQgwC8NBT">Send MMP Attribution</a>.</li><li>Key-value pair that specifies a particular version. For example, to install a specific APK version of <em>MyFunGames</em>, send the following string:<br><code>bundle.putString(SdkConstants.HOST\_APP\_OPERATOR\_TOKEN\_NAME, "MyFunGames")</code></li></ul><p></p><p>You can send any key-value pair in the metadata bundle. However, prior to sending the key-value pairs, inform DT which APK version you want to associate with each key-value pair.</p> |
| `action`   | Optional | Bundle    | <p>Bundle containing the broadcast to be triggered asynchronously as task progresses. In the bundle, specify the fully qualified class name of <code>BroadcastReceiver</code> to receive status and progress updates. </p><p>For example:<br><code>com.myapp.receivers.MyBroadcastReceiver.kt</code></p><p>You can receive installation progress updates either by broadcasts, callbacks, or a combination of both.</p><p></p><p>For more information, see <a href="/pages/ToFeh1vIUT10OpGAhNKp#broadcast">Notifications by Broadcast</a>.</p>                                                                                                                                                                                      |
| `config`   | Optional | Object    | An instance of a custom `RequestConfig` object, providing settings to override the default retry and timeout policies for the installation task. For more information, see [Set Retry Policy](/dt-ignite/ignite-services/sdk-reference/set-retry-policy.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

## Reconnecting to Ongoing Installations <a href="#h_01k19z37zbrpbfswar526e5t46" id="h_01k19z37zbrpbfswar526e5t46"></a>

If you call `install()` for an installation that is already in progress, the SDK attempts to reconnect to the existing installation task. To better monitor installation progress, DT recommends specifying a way of receiving installation status (either by callback or broadcast) to obtain a `taskId` that you can use to track task status and troubleshoot errors.

## Examples <a href="#h_01k19z37zbx2j0qv6ys29t5647" id="h_01k19z37zbx2j0qv6ys29t5647"></a>

The following code snippets show how to call the `install()` method to install an app.

### Install App by Package Name <a href="#h_01k19z37zbjx2fxtj04h76x088" id="h_01k19z37zbjx2fxtj04h76x088"></a>

The following snippet initiates the installation of an app identified by its package name.

{% code title="Kotlin" %}

```kotlin
// Initialization 

// Install application via package name string and do not listen to updates
val packageName = "com.package.name"
IgniteServiceSdk.instance().install(packageName)

// ...
```

{% endcode %}

### &#x20;Install App by URI

The following snippet initiates the installation of `MyFunGame.apk` by specifying its URI.

{% code title="Kotlin" %}

```kotlin
// Initialization

// Install application via uri string and do not listen to updates
val file = File("${context.filesDir}", "MyFunGame.apk")
val uriString = file.toUri().toString()

IgniteServiceSdk.instance().install(uriString)

// ...
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalturbine.com/dt-ignite/ignite-services/sdk-reference/install-app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
