3

I am trying to get an ad banner on my Kivy android app. Below is the test app that was referenced from this website.

from kivmob import KivMob, TestIds

from kivy.app import App
from kivy.uix.label import Label

class BannerTest(App):
    """ Displays a banner ad at top of the screen.
    """

    def build(self):
        self.ads = KivMob(TestIds.APP)
        self.ads.new_banner(TestIds.BANNER, top_pos=True)
        self.ads.request_banner()
        self.ads.show_banner()
        return Label(text='Banner Ad Demo')

if __name__ == "__main__":
    BannerTest().run()

I have also setup my bulldozer.spec file to look like this:

requirements = kivy, android, jnius, kivmob
...
android.permissions = INTERNET, ACCESS_NETWORK_STATE
android.api = 27
android.minapi = 21
android.sdk = 24
android.ndk = 19b
android.gradle_dependencies = 'com.google.firebase:firebase-ads:10.2.0'
p4a.branch = master
# For test ads, use application ID ca-app-pub-3940256099942544~3347511713
android.meta_data = com.google.android.gms.ads.APPLICATION_ID=ca-app-pub-3940256099942544~3347511713

I can successfully deploy it to my android but when I do I just get a "Banner Ad Demo" text in the middle of the screen and no actual banner ad popping up. What am I missing?

Andrew Hicks
  • 572
  • 1
  • 6
  • 19
  • I tried yesterday with the same result (my own keys and all). Seems like the support has been dropped with the android api 27. Have you had a look at kivmob27 ? The python-for-android27 is outdated (not the master branch) so I can't build. There is a way to modify p4a-master (search for a blogpost) but it hasn't worked for me either. – Sy Ker Dec 10 '20 at 13:45

2 Answers2

0

Please add python3 in requirements buildizer.spec file Also make android api to 28

0

Use this Enum of test ad ids provided by AdMob. This allows developers to test displaying ad without setting up an AdMob account.

http://kivmob.com/kivmob.html

You can replace TestIds.App with 'ca-app-pub-3940256099942544~3347511713' That is self.ads = KivMob('ca-app-pub-3940256099942544~3347511713')

And also self.ads.new_banner('ca-app-pub-3940256099942544/6300978111', top_pos=True)

AOS
  • 1