1

I tested a banner ad with a test ID and it was showing fine, after that I procceeded to change the adUnitId to the actual Id AdMob gave me and I initialized MobileAds in application clas. I published my app on the play store, linked it to AdMob, and configured a payment profile. AdMob says the banner ad is active, but I downloaded my app and reinstalled it and the ads are not showing. Could i be missing some step?

Relevant Code:

this is the application class:

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        MobileAds.initialize(getApplicationContext(), "ca-app-pub-8983537837429131~3925299209");

    }

The activity where the banner ad is supposed to show:

public class EntryActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_entry);

        Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        final AdView adView = (AdView)this.findViewById(R.id.adView);

        AdRequest adRequest = new AdRequest.Builder().build();

        adView.loadAd(adRequest);
}

And it's xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+id/entryActivityLayout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:ads="http://schemas.android.com/apk/libs/com.google.ads‌​"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:focusable="true"
    android:focusableInTouchMode="true"
    tools:context="com.bastardo.francisco.fitjournal.activities.EntryActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/my_toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:elevation="4dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>


    <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="My-banner-ad-Id"/>

</RelativeLayout>

As i said, test ads were showing just fine but the real ads are not showing. My app is linked with the play store in AdMob and i already configured a payment profile. Is there any other step? How long do I have to wait for apps to display?

F_Bass
  • 343
  • 4
  • 17

1 Answers1

0

Sometime the ads take few hours to show up, this is because there is not enough data to show relevant ads in your app.

If you app is current in the playstore try to download it in other device with diferent Google account, if you can se the ads so there is no problem.

Eduardo Corona
  • 1,262
  • 4
  • 20
  • 31
  • Well turns out everyone else can see the ads but me. Maybe it's because my google account is the same as the developer account? Anyways, thank you very much! – F_Bass Jun 13 '17 at 23:08
  • Also I forgot that if your are running the debug version of your app (that one that Android Studio installas wen you run the app from the ide) the ads will no show for "secury" reasons, so if you click in your own ads the is no risk of getting banned but anyway, don click them. – Eduardo Corona Jun 14 '17 at 00:05