johnrao07
johnrao07

Reputation: 6938

Admob Test ads are showing but Real Ads are not showing up

What could be the issue?

Here is the snippet from my code

.....

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"           
    android:layout_height="wrap_content
    android:gravity="center"                
    <com.eva***.flo***ion.FloodView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/floodView"
        android:layout_margin="5dp"/>
</LinearLayout>

....

Java Code

AdView mAdView = (AdView) findViewById(R.id.adViewGame);
AdRequest adRequest = new AdRequest.Builder()
    .addTestDevice("27C******996125")
    .build();
mAdView.loadAd(adRequest);

What could possibly I am doing wrong?

Upvotes: 0

Views: 1113

Answers (2)

user2111879
user2111879

Reputation:

There are some things missing:

your adView is not in the code, there is no banner size specified, your have to add the publisher code from admob.

Example:

<com.google.android.gms.ads.AdView      xmlns:ads="http://schemas.android.com/apk/res-auto"
                android:id="@+id/adViewGame"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentRight="true"
                ads:adSize="BANNER"
                ads:adUnitId="your banner id"> <!-- publisher code -->
</com.google.android.gms.ads.AdView>

Code:

 mAdViewBanner = (AdView) findViewById(R.id.adViewGame);

            adRequestBanner = new AdRequest.Builder()
                    .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                    .addTestDevice("6CACC2xxxxxxxxFA1499F5");

mAdViewBanner.loadAd(adRequestBanner);

Upvotes: 0

user5759258
user5759258

Reputation:

Don't add a test device since this is a real ad.

Upvotes: 2

Related Questions