Android Question Advert Sizings Issue's

chris ash

Member
Licensed User
Longtime User
Hello guys

Wondering if anyone could help me out with some coding advice.

So I have been creating apps for a while now using B4a and the standard admob view sizing setup has worked well.

However on the latest generations of Samsung S8+ and S9+ the adverts very rarely work.

I have tried the standard method to work out the view size, and the newer check size in terms of screen height in dip. But still to no avail.

What happens is the request is submitted I get an ad back but when I then try to create the view for it the code I use to work out the sizing in both cases says 32 high. However I see and error in the logs saying it needs a height of 50. I suspect it may be something I am doing wrong but I have tried so many combinations I lose track and I have not found anything that works consistently on all devices.

Does anyone have any code that they use and believe to be bulletproof that I can try, hopefully to solve this issue.

Kind regards
CAsh
 

chris ash

Member
Licensed User
Longtime User
Hi Erel

Thanks for the reply. I get that I can just tell it to use a 50dip area. But then the adverts seem to take up a very large proportion of the screen.

The models mentioned above have tall narrow screens. So putting an advert that is bigger than it needs to be means it take up a lot of the height on a screen which doesn't have a lot to start with.

Also if you then apply this logic for other normal screen, it can be ridiculously big, especially on low res screens.

I was thinking more along the lines of is there something I can do to make it return an ad that will fit a 32dip height view? (Why cant I for example use a 32dip height smart banner? Other than I seem to get 50dip height banner returned)

If not no problem but surely I cannot be the only person that has noticed this on the latest flagship Samsung devices?
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I use SMART_BANNER with:
- height = 50dip to phones and 90dip to tablets.
- width = 100%x.
B4X:
AdView1.Initialize2("Ad", "ca-app-pub-x", AdView1.SIZE_SMART_BANNER)
Activity.AddView(AdView1, 0dip, 100%y - 50dip, 100%x, 50dip)
 
Upvote 0
Top