Android Example The (almost) Definitive Admob Example

asales

Well-Known Member
Licensed User
To help the new members to make money with B4A, I tried to compile all the relevant Admob code (except mediation) of the forum in this example and put comments and links.
This is a work in progress.
Any code and sample to improve this example are welcome.

Follow these instructions to start:
1. Integrating Firebase Services
- https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/
2. FirebaseAdMob - Admob ads integrated with Firebase backend
- https://www.b4x.com/android/forum/threads/firebaseadmob-admob-ads-integrated-with-firebase-backend.67710/#content
3. FirebaseAdMob v1.6
- https://www.b4x.com/android/forum/threads/firebaseadmob-v1-6.108552/
4. B4A 9.80 and SDK Manager up to date.

admob_example2.png
 

Attachments

Last edited:

Mike1970

Active Member
Licensed User
GREAT WORK. With the tutorials on the forum i couldn't get a functioning example. But with this i can finally start to study this thing.

However there is an error in the "Banner Module"

Line 116
B4X:
java.lang.RuntimeException: Method: getCurrentOrientationAnchoredAdaptiveBannerAdSize not found in: com.google.android.gms.ads.AdSize
 

Michele Balzano

New Member
Licensed User
Ho provato ad utilizzare il codice con l'ultima versione di B4A, ma ricevo sempre l'errore
Errore analisi google-services.json:
Il file 'C: \ Users \ miche \ OneDrive \ Desktop \ AdmobExample_Forum \ google-services.json' non è stato trovato. dove posso scaricare il file?
grazie
 

Mike1970

Active Member
Licensed User
Ho provato ad utilizzare il codice con l'ultima versione di B4A, ma ricevo sempre l'errore
Errore analisi google-services.json:
Il file 'C: \ Users \ miche \ OneDrive \ Desktop \ AdmobExample_Forum \ google-services.json' non è stato trovato. dove posso scaricare il file?
grazie
You must follow the Erel’s guide about the integration of Firebase here, there is a step where you have to download that file and put it in the app folder
 
Top