B4A Library AdMob library

This library requires some configuration. Please see the tutorial: http://www.b4x.com/forum/basic4andr...-admob-tutorial-add-ads-your-application.html

Reference: Basic4android - AdMob

AdMob v2.00 - Based on Google Play Services. This version requires B4A v3.20.

AdMob v1.40 - Add support for SIZE_SMART_BANNER.
These ads will fill the whole available width: https://developers.google.com/mobile-ads-sdk/docs/admob/smart-banners

You can use the following code:
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)

See this post for an additional requirement if using google play services v28: https://www.b4x.com/android/forum/threads/admob-library.7301/page-10#post-381519
 

Attachments

  • AdMob_old.zip
    4.3 KB · Views: 977
  • AdMob.zip
    4.7 KB · Views: 2,861
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
Missing jar file in library

Hi Erel,

After installing the AdMob library v1.10. I get the message when starting the IDE:

B4X:
Misising jar file for library:
E:\Basic4Android\libraries\GoogleAdMobAdsSDK.xml

The jar file is missing from the zip file. Please check times the zip file.

best regards
Amalkotey
 
Last edited:

susu

Well-Known Member
Licensed User
Longtime User
Do I need to update my apps with new Admob library, Erel?
 

susu

Well-Known Member
Licensed User
Longtime User
Thanks Erel. But I noticed that my renevue is dropping from about $1/day to $0.1/day
 

jndaniels1

Member
Licensed User
Longtime User

Try renaming the jar file to: GoogleAdMobAdsSDK.jar

.JND.
 

Gmankelow

Member
Licensed User
Longtime User
Downloading the AdMob.zip

I cannot download the Admob zip, clicking on it says I have insufficient permission and if I do right click save as it is not the true zip?

Is it for Licensed users only?
 

susu

Well-Known Member
Licensed User
Longtime User
Admob informed that my apps got "code update available" although I used Admob lib v1.1 already. So Admob lib need to be upgraded?
 

susu

Well-Known Member
Licensed User
Longtime User
Thank you, Erel.
 

Omar

Member
Licensed User
Longtime User
Just a quick question, is it necessary to update the Google JAR file in the additional libraries folder each time for every new application or can we retain the same file for new applications also?
 

Inman

Well-Known Member
Licensed User
Longtime User
Got an email from Admob today announcing a new update:


I am wondering if this calls for any changes to the B4A Admob wrapper.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…