문제

I've pubished Apps in the past, before Adsense was introduced.
The Adunit was in the format a1234567890123c, so in my layout I would have a line like

ads:adUnitId="a1234567890123c"

Now, the format is like ca-app-pub-1234567890123456/1234567890

So should my layout have this in the line

ads:adUnitId="ca-app-pub-1234567890123456/1234567890"

Is the line in the activity still required, and will it be the new format?

adView = new AdView( this, AdSize.BANNER, "ca-app-pub-1234567890123456/1234567890" );
도움이 되었습니까?

해결책

So should my layout have this in the line

ads:adUnitId="ca-app-pub-1234567890123456/1234567890"

Yes, if you are defining your Adview via XML.

Is the line in the activity still required, and will it be the new format?

adView = new AdView( this, AdSize.BANNER, "ca-app-pub-1234567890123456/1234567890"

Construction of the AdView in your Activity is only required if you haven't defined it via XML. Ie you either construct the AdView in XML or in code.

And yes, the AdUnitId in code is the same as that used in XML.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top