Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Android 외부브라우저
- 페이스아이디 마스크
- Android Intent Bundle
- Android 광고
- Kotlin 형변환
- Android Button 대문자
- Android 화면 꺼짐 방지
- Android 프로젝트명 변경
- Android Intent data
- Android Admob Test ID
- 애플워치 완충
- Android
- Chrome Dark
- Admob Banner
- mac java
- Android 값전달
- Android LiveData
- 애플워치
- Android Bundle
- 아이폰 알림 워치
- Android Progressbar
- Basic Android
- Chrome Dark Mode
- Android Jcenter
- Basic Fragment
- 혼자 만들었다!
- 현재 버전
- Android Intent Bundle Data
- Android Fragment Sample
- Android Jcenter Warning
Archives
- Today
- Total
배고파
[Android] Admob 적용하기 (Banner) 본문
안녕하세요.
Admob Banner 적용하는것을 알려드리겠습니다.
1. gradle 파일
2. manifest 파일
3. xml 파일
4. activity 파일
이렇게 수정 하시면 됩니다.
1. gradle 파일 부분 입니다.
implementation 'com.google.android.gms:play-services-ads:19.7.0'
2. manifest 파일 입니다.
<application
... >
<activity
... />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="admob_app_id" />
</application>
3. xml 파일
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="고유 배너 아이디">
</com.google.android.gms.ads.AdView>
4. activity 팡리
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
AdView mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
정확하고 자세한 부분은 하단 링크를 참조해 주세요.
developers.google.com/admob/android/banner?hl=ko#add_adview
'Developer > Android' 카테고리의 다른 글
[Android] 외부브라우저 (0) | 2021.02.01 |
---|---|
[Android] 현재 버전 (0) | 2021.02.01 |
[Android] Admob 테스트 광고 ID (0) | 2021.02.01 |
[Android] Intent Bundle (0) | 2021.02.01 |
Kotlin 형변환 (0) | 2021.01.22 |