i have set test device sill getting live ads..
mAdView = (NativeExpressAdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("722378CE522E161F0EFAD13A658F5161")
.addTestDevice("048B0A7DC3863535720E0C21AC1C58FD")
.build();
mAdView.loadAd(adRequest);
and my xml code is:
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_above="@+id/l2"
ads:adSize="360x80"
ads:adUnitId="@string/native_ads"
/>
For getting test native express ads, use following ad unit id-
<string name="native_ad_test_unit_id">ca-app-pub-3940256099942544/6300978111</string>
For getting full width ads, use the FULL_WIDTH constant in the adSize. For example, your code should be
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_above="@+id/l2"
ads:adSize="FULL_WIDTHx80"
ads:adUnitId="@string/native_ads"
/>
Use
ca-app-pub-3940256099942544/6300978111
instead of your own Ad unit id.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With