admob help

fifiddu70

Well-Known Member
Licensed User
Longtime User
can someone make a tutorial video on how to install admob on a program developed with basic4android? I would like to put on a admob my application, but I do not know how to do, help
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
this tutorial present a problem in my basic4android softwares


B4X:
</b>
the code is in red colors, why?
 
Upvote 0

pluton

Active Member
Licensed User
Longtime User
That is error in forum code. It has mistake.
The correct code is:

B4X:
Sub Process_Globals
    
End Sub

Sub Globals
    Dim AdView1 As AdView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    AdView1.Initialize("Ad", "YourPublisherId") 'publisher id that you received from AdMob.
    Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip) 'previously the height was 48dip. Now it is 50dip.
    AdView1.LoadAd 'loads an ad
End Sub

Sub Ad_FailedToReceiveAd (ErrorCode As String)
    Log("failed: " & ErrorCode)
End Sub
Sub Ad_ReceiveAd
    Log("received")
End Sub
Sub Ad_AdScreenDismissed
    Log("screen dismissed")
End Sub


Just delete that </b>
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…