Is it normal not to see anything indicating if I have implemented ads correctly in my app?

Asked

Viewed 479 times

2

Obviously I don’t expect any real adverts to appear, but some indication that I did the procedure correctly so I know if it’s all right.

1st Image (Preview Android Studio)

inserir a descrição da imagem aqui

2nd image (Application on virtual machine)

inserir a descrição da imagem aqui

As shown nothing appears, so I have no idea.

Activity XML

<com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit"/>
  • 2

    @Dummy Symphore you tested the test ads offered by adMob itself (you need to set the id’s according to the Admob tutorial and use an emulator device Id, also in the tutorial). These always appear. Usually real banners do not appear when id’s or json is invalid, but test banners always appear.

  • https://firebase.google.com/docs/admob/android/quick-start?hl=pt-br

  • https://developers.google.com/admob/android/test-ads?hl=pt-br

  • 2

    If you recently created an account as a published one, ads will take a few moments to appear.

1 answer

1


Adding the following lines, I was able to resolve my question:

Mainactivity

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class

private AdView adView01;
private AdRequest adRequest01;

onCreate

adView01=(AdView)findViewById(R.id.adView01);
adRequest01=new AdRequest.Builder().build();
adView01.loadAd(adRequest01);

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.