# 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="../receive-installation-notifications#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="send-mmp-attribution">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="../receive-installation-notifications#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](https://docs.digitalturbine.com/dt-ignite/ignite-services/sdk-reference/set-retry-policy).                                                                                                                                                                                                                                                                                                                                                                                                                                     |

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