Android Question Admob confusion??

Mohamed Akbarally

Member
Licensed User
Longtime User
Hi, so I am trying to create an app with ads. I followed every step the admob post in this forum said ( I installed all the libraries, and created an account"

However the ad never shows up on my screen. I am using the following code under activity create sub.
( the x's are of course replaced with my id)

B4X:
AdView1.Initialize2("Ad", "cap-app-pub-xxxxxxxx/xxxxxxxx", AdView1.SIZE_SMART_BANNER)
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
   'phones
   If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
   'tablets
   height = 90dip
End If
Activity.AddView(AdView1, 0dip, 100%y - height, 100%x, height)
       AdView1.BringToFront
 
Top