Admob ad click test
When you add an AdMob ad, you need to test the ad click at least once.
However, if you just click on the ad, the ad account may be suspended due to abusing.
If you test it several times to check if it works well, the chances of your account being suspended will also increase.
So, before testing the ad click, when creating an AdRequest object as shown below
You need to add code that registers the test device.
// 에뮬레이터와 특정 단말을 테스트 device로 등록한다.
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("9797C2E9DA1A88370BEB28A1A38XXXXX")
.build();
AdRequest.DEVICE_ID_EMULATOR is a code that registers the emulator as a test terminal.
9797C2E9DA1A88370BEB28A1A38XXXXX is the device ID of a specific terminal.
To check the device ID, filter the logcat tag by "Ads" and display an admob ad.
You can check the device ID of the device.
If the test device ID is well registered, a test advertisement is displayed, and it is okay to perform a click test.
Before distributing the APK, the addTestDevice part must be removed.
And since the AdRequest object of all AdMob ads such as interstitial ads and bottom banner is the same, one function
It is convenient to create and manage addTestDevice code to add or remove.