Here is the thing, as you might know Admob has a AdSize.*
function, where u put Banner
to show banner ads, and AD_banner` for tablet banners, what i want to do is take a screen size of a device so that i could throw it in my if statement and then put the right banner for right device, i hope i was clear enough.So anyone can tell me how can i get the screen size of device?
Thank u
//////////
Here's what i have done so far
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
if (dm.density==DisplayMetrics.DENSITY_HIGH) {
AdView adView = new AdView(this, AdSize.BANNER,s);
LinearLayout layout = (LinearLayout)findViewById(R.id.admob);
layout.addView(adView);
adView.loadAd(new AdRequest());
}
if (dm.density==DisplayMetrics.DENSITY_DEFAULT || dm.density==DisplayMetrics.DENSITY_LOW ) {
AdView adView = new AdView(this, AdSize.BANNER,s);
LinearLayout layout = (LinearLayout)findViewById(R.id.admob);
layout.addView(adView);
adView.loadAd(new AdRequest());
}
if(dm.density==DisplayMetrics.DENSITY_MEDIUM)
{
AdView adView = new AdView(this, AdSize.IAB_BANNER,s);
LinearLayout layout = (LinearLayout)findViewById(R.id.admob);
layout.addView(adView);
adView.loadAd(new AdRequest());
}