# 시작하기

## **최신 NestAds SDK 버전**

* [릴리즈 노트](https://docs.nestads.com/nestads-sdk-dev/android/release-notes) 를 확인해주세요.

***

## **최소 지원 사양**

* Android 5.0 Lollipop 이상
* minSdkVersion 21 이상
* [Offerwall 광고](https://docs.nestads.com/nestads-sdk-dev/android/ad-formats/offerwall) 사용 시 minSdkVersion 24 이상
* compileSdkVersion 33 이상

***

## NestAds **SDK** 추가

1. 프로젝트 단 `settings.gradle` 파일에 아래의 `Maven central repository`와 `wisebirds repository`를 추가합니다.

> Kotlin 1.7.x 와 Kotlin 1.9.x 로 빌드된 SDK 중 선택하여 추가할 수 있습니다.

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

```gradle
dependencyResolutionManagement {
   repositories {
       mavenCentral()
       
       // Kotlin 1.7.x 로 빌드된 SDK
       maven { url 'https://nexus.wisebirds.ai/repository/releases-k1_7/' }
     
       // Kotlin 1.9.x 로 빌드된 SDK
       maven { url 'https://nexus.wisebirds.ai/repository/releases/' }
   }
}
```

{% endtab %}
{% endtabs %}

2. 어플리케이션 단 `build.gradle` 파일에 아래의 `dependency`를 추가합니다.

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

```gradle
dependencies {
   implementation 'com.nestads:nestads-sdk-android:${version}'
}
```

{% endtab %}
{% endtabs %}

***

## SDK 초기화

광고를 로드하기 전에 앱에서 NestAds SDK를 [NestAds](https://docs.nestads.com/nestads-sdk-dev/android/reference/nestads).`initialize` 함수를 이용하여 초기화해야 합니다.

Activity에서 초기화하는 예제는 다음과 같습니다.

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

```kotlin
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        NestAds.initialize(context = this)
    }
}
```

{% endtab %}
{% endtabs %}

***

## 프록시 호스트 설정 (선택)

Ad Blocker 환경에서 광고 차단을 우회해야 하는 경우, 매체사가 운영하는 프록시 서버를 통해 NestAds 요청을 라우팅할 수 있습니다. `initialize()` 호출 시 `proxyHost` 파라미터를 함께 전달하면, SDK 의 모든 광고 요청, 트래킹, 에러 로그 요청 도메인이 해당 origin 으로 치환됩니다.

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

```kotlin
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        NestAds.initialize(
            context = this,
            proxyHost = "https://ad-proxy.your-domain.com",
        )
    }
}
```

{% endtab %}
{% endtabs %}

`proxyHost` 는 `http://` 또는 `https://` 로 시작하는 origin 만 허용되며 (path / query / fragment 불가), 유효하지 않은 값은 무시되고 NestAds 기본 도메인으로 동작합니다. 설정 이후 다시 기본 도메인으로 되돌리려면 [NestAds.clearProxyHost()](https://docs.nestads.com/nestads-sdk-dev/android/reference/nestads) 를 호출하세요.

{% hint style="info" %}
프록시 서버 구성 방법(Nginx 예시, upstream 매핑, 캐싱·타임아웃 유의사항)은 [Proxy Server 설정 가이드](https://docs.nestads.com/nestads-sdk-dev/proxy-server/proxy-server-guide)를 참고해주세요.
{% endhint %}


---

# 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.nestads.com/nestads-sdk-dev/android/readme.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.
