Android Question AdMob dont working on old devices

Douglas Farias

Expert
Licensed User
Longtime User
Hi all
I m tested today on a old device my app, and i see the admob dont work, the ad dont show on this old device. android version is 2.3.6

Admob its working fine on my devices 4.0+ but not on the 2.3.6 (i dont know 3.0+)

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="22" />
my manifest its normal i think

Anyone know this, have this same problem? how load admob on old devices?

failed: 1

NOTE: Interstitial works fine, only banner not
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
FIXED

i have change
B4X:
Adview1.Initialize2("Ad", "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)

to

B4X:
adbox.Initialize("Ad", "xxxxxxxxxxx")
Activity.AddView(adbox, (Activity.Width - 320dip) / 2 , 75%y, 320dip, 50dip)

now works on Android 2.3+, i think the problem its on SIZE_SMART_BANNER or on initialize2
Thx Solved
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
notice that it will only work with a screen width of minimum 320 pixels.

I also have a phone that has 240x400 and it won't show there I've read on their site.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
hmm my case its landscape i think hav no problems.
but this is a problem for portrait use, (SIZE_SMART_BANNER) dont work on old devices, and cant add 320 o_O
 
Upvote 0
Top