Question

I'm displaying my app within a dialog. The dialog doesn't cover the full screenwith (at least 320dip). Therefore, using AdMob is a bit of a problem, because all AdSizes I've seen take up at least 320dip width. So my question is: is there a possibility to still use AdMob, but with a ad less than 320dip wide (about 280dip or so).

Was it helpful?

Solution

Short answer No. Long answer is you are probably looking at this wrong.

But what do you mean "I'm display my app within a dialog"?

If you have applied a dialog style to your app or are even dispalying all of your UI within a dialog (weird) then you can always configure a dialog to have any width. So make it 320 dip.

OTHER TIPS

Looks like no. You can have a look at the documentation https://developers.google.com/mobile-ads-sdk/docs/admob/smart-banners

Not really a solution, but may be a work around: This will force the adView to be smaller. It will chop off some pixels, but the overall result may be good enough.

 final ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(m_width,//
            LinearLayout.LayoutParams.WRAP_CONTENT);

    adView.setLayoutParams(params);
    adView.loadAd(adReqBuilder.build());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top