Android Question Activities & AdMob

fishwolf

Well-Known Member
Licensed User
Longtime User
I have a B4A (and B4I) application with a main activity with 5 buttons, when select a button open a activity for each button.
Each activity have a AdMob banner.
All work fine.
The problem is that the banner is loaded again for each activity, it's showed many times, but for a bit of time.
The result is many impression, but a bit of money.

as I avoid this problem?
 

fishwolf

Well-Known Member
Licensed User
Longtime User
The question is:

can i create a fragment effect?
or
can i create a AdMob banner to main activity and show the same banner into sub-activities?
 
Last edited:
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
i have done in this mode, now the second activity don't receive a new banner, but into secondo activity the banner is not received again (no Ad_ReceiveAd event).

Main activity
B4X:
Sub Globals
  Dim AdView1 As AdView
End Sub

Sub Activity_Create(FirstTime As Boolean)

  Activity.LoadLayout("Main")

  AdView1.Initialize("Ad", "xxxxxxxxxxxxxxxxxxxxx/yyyyyyyyyy")  
  Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
  AdView1.LoadAd 'loads an ad
  AdView1.Background = Null
    
End Sub

Sub ButtonShow_Click
  
   AdView1.RemoveView
   StartActivity(Show)
   CallSubDelayed2(Show,"SetAdView",AdView1)
  
End Sub

Show Activity
B4X:
Sub Globals
   Dim AdView1 As AdView
End Sub

Sub SetAdView (Banner As AdView)
   AdView1 = Banner
   Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
End Sub

Sub Activity_Create(FirstTime As Boolean)

   Activity.LoadLayout("Show")

End Sub
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
i already done in this mode.
to your experience, it's best for money

1) 3 banner for 10 seconds
or
2) 1 banner for 30 seconds

if the timer banner is 30 seconds.
 
Upvote 0
Top