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: 1,126
  • AdMob.zip
    4.7 KB · Views: 3,016
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
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

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:

Admob said:
Since the AdMob acquisition closed a year ago, we have been busy developing products that build on our respective strengths and help move the mobile advertising ecosystem forward. We are pleased to inform you that we have just built new architecture that integrates both AdMob and Google platforms together.

To minimize issues and updates required in the future, you will need to migrate to our new unified Google AdMob Ads SDK, which is now available for both Android and iOS. Migrating over to the new SDK as soon as possible will enable access to automatic updates and fixes, reducing the number of times you'll need to resubmit your app to the app stores. The new SDKs are available to download today from within your account. Simply log in and click the upgrade button next to any site ID to start downloading the latest SDK.

Additionally, the latest SDK will allow you to access benefits such as:
New tablet and rich media ad units. Get access to additional tablet ad units sizes (728x90, 300x250, 468x60) and richer ad units from advertisers with HTML rich media ad campaigns with the new SDK.

Flexible integration with Google platforms. The new architecture ensures that you will have access to all the benefits of the Google and AdMob integration as we continue to bring both platforms together over the coming months.

You can find more detailed information about the new SDKs in the Mobile Ads Developer Guide by visiting Developer's Guide Overview - Google AdMob Ads SDK - Google Code. We look forward to continuing to help you build a business on mobile by providing you the best mobile monetization solution.

I am wondering if this calls for any changes to the B4A Admob wrapper.
 
Top