Sahil Pixel
📧 GitHub
a4k_jnius backend is a lightweight AdMob integration layer for Kivy4Admob on Android apps using Pyjnius. It supports banner ads, interstitial ads, and rewarded ads with full Java-to-Python callback support.
- ✅ Java event listener to receive ad status in Python
- ✅ Simple API with auto-threading for UI safety
Make a local copy of admob4kivy.py , java_code folder in your project
Make sure your Java code (e.g., AdmobManager.java, AdmobListener.java) is inside ./java_code/org/kivy/admob4kivy/.
Then edit your buildozer.spec as follows:
# Java source directory
android.add_src = ./java_code
# Required permissions
android.permissions = INTERNET,ACCESS_NETWORK_STATE
# AdMob App ID (Test ID shown below; replace with your own production ID)
android.meta_data = com.google.android.gms.ads.APPLICATION_ID=ca-app-pub-3940256099942544~3347511713
android.enable_androidx = True
# Required AdMob + Firebase Ads SDK
android.gradle_dependencies = com.google.android.gms:play-services-ads:22.6.0,com.google.firebase:firebase-ads:21.4.0You may also want to ensure:
requirements = python3,kivy,pyjnius,androidAdmobManager.java: Loads and shows ads using the Google Mobile Ads SDK.AdmobListener.java: Forwards Java AdMob events to Python using Pyjnius.
If you find this project helpful and want to support development, you can donate for support:
MIT License