# Remote Config

{% hint style="info" %}
This feature is supported in Android SDK 2.11.0 and above.
{% endhint %}

Remote Config is a feature that lets you replace values or properties managed in your application with parameter values defined in the Hackle Dashboard, enabling real-time control of application behavior and settings.

Navigate to the Remote Config screen in the Hackle Dashboard to configure parameters and set values according to user identification rules.

## remoteConfig

Calling the `remoteConfig()` method returns a `HackleRemoteConfig` instance containing the Remote Config information (configured parameters and rule information) for the user.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

// 원격 구성 정보 담은 인스턴스를 반환합니다.
val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

// 원격 구성 정보 담은 인스턴스를 반환합니다.
HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();
```

{% endtab %}
{% endtabs %}

## Query Remote Config Parameters

Since parameters set on the Hackle Remote Config screen exist as key-value pairs, you can use the methods below to retrieve parameter values according to the configured parameter type.

{% hint style="warning" %}
Remove Remote Config-related code after archiving.

Once a Remote Config parameter is archived, you can no longer access its parameter information. After archiving a Remote Config parameter, you must clean up the related code.
{% endhint %}

### getString

* Returns a parameter value configured as STRING or JSON type.
* Returns the default value or the value set by the rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()

val strValue: String = remoteConfig.getString("parameter_key_string_type", "defaultValue")

val jsonValue: String = remoteConfig.getString("parameter_key_json_type", "defaultValue")
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();

String strValue = remoteConfig.getString("parameter_key_string_type", "defaultValue");

String jsonValue = remoteConfig.getString("parameter_key_json_type", "defaultValue");
```

{% endtab %}
{% endtabs %}

### getInt

* Returns a parameter value configured as Number type as an Int.
* Returns the default value or the value set by the rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()

val intValue: Int = remoteConfig.getInt("parameter_key_int_type", 0)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();

int intValue = remoteConfig.getInt("parameter_key_int_type", 0);
```

{% endtab %}
{% endtabs %}

### getDouble

* Returns a parameter value configured as Number type as a Double.
* Returns the default value or the value set by the rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()

val doubleValue: Double = remoteConfig.getDouble("parameter_key_double_type", 0.0)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();

double doubleValue = remoteConfig.getDouble("parameter_key_double_type", 0.0);
```

{% endtab %}
{% endtabs %}

### getLong

* Returns a parameter value configured as Number type as a Long.
* Returns the default value or the value set by the rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()

val longValue: Long = remoteConfig.getLong("parameter_key_long_type", 0L)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();

long longValue = remoteConfig.getLong("parameter_key_long_type", 0L);
```

{% endtab %}
{% endtabs %}

### getBoolean

* Returns a parameter value configured as Boolean type.
* Returns the default value or the value set by the rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

val remoteConfig: HackleRemoteConfig = hackleApp.remoteConfig()

val booleanValue: Boolean = remoteConfig.getBoolean("parameter_key_boolean_type", false)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.android.HackleApp
import io.hackle.sdk.common.HackleRemoteConfig

HackleRemoteConfig remoteConfig = hackleApp.remoteConfig();

boolean booleanValue = remoteConfig.getBoolean("parameter_key_boolean_type", false);
```

{% endtab %}
{% endtabs %}


---

# 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.hackle.io/en/development-guide/android/android-remote-config.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.
