이틀 만에 SMART_BANNER가 좋은 클릭률 (CTR)에 가장 적합하지 않음을 알게되었고 admob의 광고 크기를 동적으로 전환해야했습니다.다른 기기의 Admob 배너 크기
여기 자바 코드가 있습니다. 4 인치 에뮬레이터에서 코드를 실행했을 때 728x90 크기의 광고가 요청되었으며 응답이 잘못된 광고 크기라는 것을 알았습니다. (오류에 대한 설명은 광고가 현재 화면에 맞지 않음) pls. 도움 :
AdSize adsize = AdSize.SMART_BANNER;
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
int orientation = display.getOrientation();
if(width >= 728 && height >= 90) {
adsize = AdSize.IAB_LEADERBOARD;
System.out.println("728 x 90");
} else if (width >= 468 && height >= 60) {
adsize = AdSize.IAB_BANNER;
System.out.println("468 x 60");
} else if (width >= 320 && height >= 50) {
adsize = AdSize.BANNER;
System.out.println("320 x 50");
}
LinearLayout adContainer = (LinearLayout) findViewById(R.id.cakes);
adView = new AdView(this, adsize, "xxxxxxxxxx");
AdRequest adRequest = new AdRequest();
adView.loadAd(adRequest);
// Place the ad view.
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
adContainer.addView(adView, params);
그리고 Admob 조정에는 SMART_BANNER를 사용하지 않는 것이 좋습니다. –