336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
전면광고 넣기 - 이건 java만 있어도 가능.
==================
이걸 적용하려면 가장 먼저 해야할 게 있다..
이것 3, 4 실행
출처 : http://webnautes.tistory.com/661
===================
아래 필요한 부분에 소스 넣기
출처 :
https://developers.google.com/mobile-ads-sdk/docs/adx/android/interstitial#interstitialad
중간 내용
메인 액티비티 안에 저 코드를 맞춰서 넣으면 된다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | // 클래스 안에 쓰기. 굵게 표시한 부분 private InterstitialAd interstitial; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Create the interstitial. interstitial = new InterstitialAd(this); interstitial.setAdUnitId(" 애드몹 코드 ca-... 넣기 "); // Create ad request. AdRequest adRequest = new AdRequest.Builder().build(); // Begin loading your interstitial. interstitial.loadAd(adRequest); // start Ads interstitial.setAdListener(new AdListener() { public void onAdLoaded() { displayInterstitial(); } }); } // Invoke displayInterstitial() when you are ready to display an interstitial. public void displayInterstitial() { if (interstitial.isLoaded()) { interstitial.show(); } } | cs |
추가로 저걸 사용하려면?
출처 : http://stackoverflow.com/questions/20854789/admob-interstitial-ad-wont-display
1 2 3 4 5 6 | // start interstitial.setAdListener(new AdListener() { public void onAdLoaded() { displayInterstitial(); } }); | cs |
'Android Studio' 카테고리의 다른 글
(Android Studio) Error! : finished with non-zero exit value 1 (0) | 2016.05.20 |
---|---|
(Android Studio) 안드로이드 간단한 메뉴 버튼 이벤트 (0) | 2016.05.20 |
(Android Studio) Error! : You need to use a Theme.AppCompat theme (or descendant) with this activity. (0) | 2016.05.20 |
(Android Studio) 스플래시액티비티 이용 방법 (0) | 2016.05.20 |
(Android Studio) 최근사용앱화면에서 앱화면 가리기(홀드키 꾹화면) (0) | 2016.05.20 |