Hello,
I followed all the steps ie:
- Copied the google service jar
- Got my API key / AdMob ID
- Edited the manifest
- Added the additional res
- Added AddMob library
Everything compiles correctly but when I execute the app it crashes.
Here is the code:
It crash even if I comment Adview1.LoadAd
Any idea how I can find the reason ?
I use google play service API 19 and B4A 3.20
Regards,
Himred
I followed all the steps ie:
- Copied the google service jar
- Got my API key / AdMob ID
- Edited the manifest
- Added the additional res
- Added AddMob library
Everything compiles correctly but when I execute the app it crashes.
Here is the code:
B4X:
#Region Project Attributes
#ApplicationLabel: MobAppTest
#VersionCode: 40
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#AdditionalRes: C:\Users\Me\Documents\Coding\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim AdView1 As AdView
End Sub
Sub Activity_Create(FirstTime As Boolean)
AdView1.Initialize2("Ad", "ca-app-pub-MYIDHIDDEN", AdView1.SIZE_SMART_BANNER)
Dim Height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
If 100%x > 100%y Then Height = 32dip Else Height = 50dip
Else
Height = 90dip
End If
Activity.AddView(AdView1, 0dip, 100%y - Height, 100%x, Height)
AdView1.LoadAd
End Sub
Sub Activity_Resume
AdView1.Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
AdView1.Pause
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
It crash even if I comment Adview1.LoadAd
Any idea how I can find the reason ?
I use google play service API 19 and B4A 3.20
Regards,
Himred