Android / Admob: can I set the list of test devices in Layout XML format for AdView?

So, I currently have an AdView in my layout, for example:

<com.google.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" ads:adUnitId="XXXXXXXXXXXXXX" ads:adSize="BANNER" ads:loadAdOnCreate="false"/> 

and it works great. However, I have to get AdView in the source code in order to send him a request for the emulator, and my personal phone is TestingDevices and not receive real ads. Is there a way that I can list in XML? or even get AdView to display ONLY test ads, so I don’t need to have this piece of code and can you configure AdView to load AdOnCreate?

Thanks.

+4
source share
1 answer

Of course, add this to xml:

 ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" 

I found it here: https://developers.google.com/mobile-ads-sdk/docs/android/banner_xml

+5
source

All Articles