Android 타겟팅 설정하기
오디언스 타겟팅 설정하기
1
Adrop 초기화
// 1. Application Context를 사용하세요.
// 2. production = true 를 사용하세요.
// 3. 특정 국가에서 이 SDK를 사용하고 있다면,
// ISO 3166 alpha-2 국가 코드 array를 전달하세요.
val production = true
val targetCountries = arrayOf<String>()
Adrop.initialize(application, production, targetCountries)// 1. Application Context를 사용하세요.
// 2. production = true 를 사용하세요.
// 3. 특정 국가에서 이 SDK를 사용하고 있다면,
// ISO 3166 alpha-2 국가 코드 array를 전달하세요.
Boolean production = true;
String[] targetCountries = {};
Adrop.INSTANCE.initialize(getApplication(), production, targetCountries);2
setProperty
앱 사용자를 설명하는 속성을 설정할 수 있습니다. 지원하는 키에 대해 사전 설정된 값을 확인하세요.
val key = "YOUR_PROPERTY_KEY"
val value = "YOUR_PROPERTY_VALUE"
// UID 설정 함수
AdropMetrics.setUID('YOUR_UID')
// 프로퍼티 설정 함수
AdropMetrics.setProperty(key, value)
// 현재 디바이스의 프로퍼티를 확인할 수 있는 함수
AdropMetrics.properties()String key = "YOUR_PROPERTY_KEY";
String value = "YOUR_PROPERTY_VALUE";
// 프로퍼티 설정 함수
AdropMetrics.INSTANCE.setProperty(key, value);
// 현재 디바이스의 프로퍼티를 확인할 수 있는 함수
AdropMetrics.INSTANCE.properties();
// UID 설정 함수
AdropMetrics.INSTANCE.setUID('YOUR_UID')문맥 타겟팅 설정하기
1
문맥 타겟팅
val unitId = "UNIT_ID"
val contextId = "CONTEXT_ID"
// Banner 문맥 광고
val banner = AdropBanner(this, unitId, contextId)
// Native 문맥 광고
val nativeAd = AdropNativeAd(this, unitId, contextId)
String unitId = "UNIT_ID";
String contextId = "CONTEXT_ID";
// Banner 광고
AdropBanner banner = new AdropBanner(this, "your_unit_id", "your_context_id");
// Native 광고
AdropNativeAd nativeAd = new AdropNativeAd(this, "your_unit_id", "your_context_id");
// Banner Activity 예시
public class MainActivity extends AppCompatActivity {
private AdropBanner banner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// contextId와 함께 Banner 광고 생성
banner = new AdropBanner(this, unitId, contextId);
banner.load();
// 레이아웃에 추가
LinearLayout container = findViewById(R.id.banner_container);
container.addView(banner);
}
}Last updated

