About Android admob

Asked 1 years ago, Updated 1 years ago, 79 views

I'm trying to put an ad on the app and I'm trying to use admob. By the way, if I set up a test device and run it with an emulator, it will be executed, but why can't I do it on an actual terminal? Nothing's coming up On banner <

    AdView main_Banner_AdView;

    main_Banner_AdView = (AdView) v.findViewById(R.id.av_main_down);
    AdRequest adRequest1 = new AdRequest.Builder()
            .build();
    main_Banner_AdView.loadAd(adRequest1);

I did the code like this, and in Emul, it was time to do the .testDevice, but it's not working because I'm connecting it to my actual phone ㅜ<

android admob

2022-09-22 13:45

1 Answers

    AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice ("Device Number").build();
    mAdView.loadAd(adRequest);

I did it like this.

  AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).build();
    mAdView.loadAd(adRequest);

First, turn on the activities with admob If you look at the console window, you will see the device number.

You can copy and paste it! And because it's a test device, there's no advertisement, and there's a phrase that says "nice job!" and there's an advertisement.

I did it not too long ago, so I was able to answer it. Haha the first answer hahaha

Note URL: http://webnautes.tistory.com/661, http://es1015.tistory.com/52

(I found how to find the device number, so it doesn't appear on the blog.)


2022-09-22 13:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.