Skip to content

ParkSangGwon/TedAdmobDialog

Repository files navigation

What is TedAdmobDialog?

English

TedAdmobDialog come from TedAdHelper
Until then, we could only do Mediation through TedAdHelper.
Becoz Admob did not support Native ad type.
But nowdays Admob support Native ad type.

But we still need back press dialog like this.
Screenshot

When you use TedAdHelper's back press dialog, you have need request and loading advertise time.
Because the request is made at the same time the dialog is shown.

TedAdmobDialog support pre advertise request.
So you can see the dialog and show ads at the same time.





Korean

TedAdmobDialogTedAdHelper에서부터 태어난 라이브러리입니다.
이전까지는 TedAdHelper를 통해 미디에이션을 해주었습니다.
왜냐하면 이전까지 Admob에서는 Native 광고에 대해서는 미디에이션을 지원하지 않았었기 때문입니다.
하지만 지금은 Admob에서 Native 광고에 대해서도 미디에이션을 지원합니다.

하지만 뒤로가기를 눌렀을때 팝업형식의 Dialog로 나오게 하는것은 여전히 필요합니다.
Screenshot

TedAdHelper에서는 다이어로그가 보여짐과 동시에 광고를 요청하기때문에 광고가 표시되기까지는 시차가 발생했었습니다.
TedAdmobDialog는 미리 광고를 로딩해두고 Dialog가 실행될때 바로 광고를 보여줄 수 있도록 지원합니다.





Mediation

Screenshot

I recommend you have to use mediation.
If you use mediation, you can earn more money using highest eCPM network.
See this document.
https://developers.google.com/admob/android/mediation
I use admob, facebook audience network network.





Setup

Gradle

Download

dependencies {
    implementation 'gun0912.ted:tedadmobdialog:x.y.z'
}



How to use

0. Type

You can use 2 type advertise

1. Pre loading

  • Make your TedAdmobDialog instance.
  • And pre load advertise using TedAdmobDialog::loadAd()
 nativeTedAdmobDialog = new TedAdmobDialog.Builder(this, TedAdmobDialog.AdType.NATIVE, AD_TEST_KEY_NATIVE)
         .setOnBackPressListener(new OnBackPressListener() {
             @Override
             public void onReviewClick() {

             }

             @Override
             public void onFinish() {
                 finish();
             }

             @Override
             public void onAdShow() {
                 nativeTedAdmobDialog.loadAd();
             }
         })
         .create();

 nativeTedAdmobDialog.loadAd();
  • When advertise shown, pre load again in onAdShow()

2. Show TedAdmobDialog

  • When you need to show advertise, call TedAdmobDialog::show()
indViewById(R.id.btn_native).setOnClickListener(new View.OnClickListener() {
   @Override
   public void onClick(View v) {
       nativeTedAdmobDialog.show();
   }
});

Customize

  • setStartMute(): If you want muted advertise, call this function in builder.
  • showReviewButton(): Dialog include review button. you can control review button's visibility.

License

Copyright 2018 Ted Park

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.```

About

[Android]BackPress Ad Dialog for Admob

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages