Question

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" );
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top