Android Question How to add AppBrain Banner

amidgeha

Member
Licensed User
For the latest Appbrain SDK (appbrain-sdk-14.60.aar) @Erel code works fine if you just remove (android:enabled="@bool/appbrain_job_service_enabled") from the manifest, you don't have to remove it if you use older Appbrain SDK such as (appbrain-sdk-14.10.aar)
B4X:
AppBrainBanner= CreateBanner("DEFAULT")
Activity.AddView(AppBrainBanner, 0, 100%y-50dip, 100%x, 50dip)
.
.
...
Sub CreateBanner (AdUnitId As String) As JavaObject
    Dim AdId As JavaObject
    Dim builderb As JavaObject
    AdId.InitializeStatic("com.appbrain.AdId")
    builderb = builderb.InitializeNewInstance("com.appbrain.AppBrainBanner", Array(ctxt))
    builderb.RunMethod("setAdId", Array(AdId.GetField(AdUnitId)))
    Return builderb
End Sub
 

Feten7

Member
Licensed User
Thanks for the information, amidgeha.
I have a question: Is it possible to select an ID for the Banner? I mean, Appbrains permits to create several banners, each one with one ID, and I want to show a specific one in one activity.
 

DonManfred

Expert
Licensed User
Top