I am trying to show AdMob ads in my activity, but it is always giving error that \"not enough space to show ad\".
My XML file is:
i had the same problem with NativeExpressAdView. If you add padding or margin to your layout, I think, it's not a good idea to fix the ad's size width. I sugger to do in programmatically
First step : get the dp size of screen witdh
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); //float dpHeight = displayMetrics.heightPixels / displayMetrics.density; dpWidth = displayMetrics.widthPixels / displayMetrics.density;
2. Second step:
mAdView.setAdSize(new AdSize((int) dpWidth, 150));