Android Question Mediated Adverts with Admob - Control

chris ash

Member
Licensed User
Longtime User
Hi guys

I may be missing something pretty simple here but I need help...

So I have been trying to use ad mediation through AdMob for quite some time with little success. Anyway owing to appalling fill rates I thought I will give it a go. The network of choice was Tappx. So using a mixture of the previous posts I have made good progress.

I now use pretty much the standard implementation of AdMob. With additions to the manifest editor

B4X:
'************ Tappx (Start) *****************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddApplicationText(
<!-- Tappx Activities -->
<activity
    android:name="com.tappx.sdk.android.AdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
    android:name="com.tappx.sdk.android.InterstitialAdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:theme="@style/Transparent" />
<activity
    android:name="com.tappx.sdk.android.VideoAdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />

<service android:name="com.tappx.sdk.android.TrackInstallIntentService" />

<!-- AdActivity from Google Play Services,, needed by Tappx -->
<activity
    android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
    android:theme="@android:style/Theme.Translucent" />

<receiver
        android:name="com.tappx.sdk.android.TrackInstallReceiver"
        android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER"/>
    </intent-filter>
</receiver>
)
'************ Tappx (End) *****************

I have then added the additional lines

B4X:
    #AdditionalJar: tappx-sdk-3.1.3.aar
    #AdditionalJar: com.google.android.gms:play-services-ads

This is all pretty much as per the guides... and the great news is when I run the app I either get an Admob ad or a Tappx one.

So... Then it comes to using the adverts and my observation is that when you load the ad the Ad_ReceiveAd sub is run whether the loaded ad is Admob or Tappx...

However, when the ad is a Tappx ad other subs such as Ad_AdScreenDismissed, Sub ad_presentscreen do not fire when they should which currently limits my ability to control the flow of the app. When the ad is Admob the subs fire exactly as they always have and should. It is only on the Mediated Tappx ad's where this does not work :-(

So the question is guys what am I missing. If you need to know anything more from me please just ask.

Thanks in advance for any assistance

Chris
 

chris ash

Member
Licensed User
Longtime User
Hi again @Erel

I have taken a look for what you described but cannot find anything of that nature.

So taking it one step further I thought why not try Tappx separate and non mediated within the app, that should work as there are a few people that have been discussing how this works. So I have set this up too. See the attached zip file this has the AdMob version and the Tappx version below it.

The AdMob version as before doesn't run the ad_present or dismissed subs

The TappX doesn't bother running the ad_event sub either, showing this error

B4X:
Ignoring event: ad_event

Again any help with how to get this working by either method would be greatly appreciated.

Chris
 

Attachments

  • Advert Example v2.zip
    12.1 KB · Views: 271
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This can happen if the activity is paused when the event is raised.
Do you think that this is the case here?

You can move the listener object to the starter service:
B4X:
Sub CreateListener (banner As JavaObject) As Object
   Return banner.CreateEventFromUI("com.tappx.sdk.android.TappxBannerListener", "ad", Null)
End Sub

Create it with:
B4X:
 Dim listener As Object = CallSub2(Starter, "CreateListener", banner)
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
tappx doesn't use the events admob uses as there is no need to rely on something else so you need to create your own listeners.
on their site the relevant info can be found to make your own class that handles everything you want with similar code as Erel posted above.

mediation is usually slower and having less fill rate than when using the real deal (straight method) so it's a good choice to do it like that.
the only good thing with mediation is the comparing ecpm values... IF it worked :)
sometimes it needs weeks to update that value and then admob is usually better earning too as not being pay per install only.
nothing as bad as leading all traffic to an ad provider with a high ecpm and not getting 1 install in the end.
 
Upvote 0
Top