I created an AdMOb ad unit 24 hours ago. The test ID works fine in the app but the real one is still taking a lot of time.
Here's what I have done on the mainactivity:
AdView ads;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
result= (EditText) findViewById(R.id.outputText);
ads = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
ads.loadAd(adRequest);
}
Here's what I did in the XML :
<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_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="31dp"
ads:adSize="BANNER"
ads:adUnitId="id goes here" />
And in the manifest file I have added
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Logcat:
I/Ads: Starting ad request. I/Ads: Use
AdRequest.Builder.addTestDevice("111938875CFC9AB024C69BABE7ED487C") to
get test ads on this device
Do I necessarily need to have a Google Play Developer account for AdMob to work ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…