Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to implement ads to Kivy App?

Tags:

kivy

Can anyone help me with any sdk for implementing ads in kivy app. Revmobs have stopped supporting Kivy. Any other method of implementing ads would also work. Thanks

like image 720
Saurabh Shrivastava Avatar asked Oct 29 '22 11:10

Saurabh Shrivastava


1 Answers

I have had success with AdBuddiz via jnius, I guess that you can use any java SDK on android this way:

PythonActivity=autoclass("org.renpy.android.PythonActivity")
AdBuddiz=autoclass("com.purplebrain.adbuddiz.sdk.AdBuddiz")

AD_CHANCE = 0.06

def init():
    AdBuddiz.setPublisherKey("YOUR SECRET KEY .... ")
    #delete this before going to play at the store...
    AdBuddiz.setTestModeActive()
    AdBuddiz.cacheAds(PythonActivity.mActivity)

def show():
    if (random.random() < AD_CHANCE):
        log.info("Showing Ad!!!")
        try:
            AdBuddiz.showAd(PythonActivity.mActivity)
        except Exception:
            log.exception("Pizza is not healthy...")
    else:
        log.warn("Skipping the AD this time ;)")

I guess that on iOS you can use PyObjC to achieve the same results...

like image 69
Yoav Glazner Avatar answered Nov 11 '22 13:11

Yoav Glazner