#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private WebView1 As WebView
Private bgp As Panel
Private ImageView1 As ImageView
Dim iad As InterstitialAd
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
iad.Initialize("iad","ca-app-pub-cccc")
#if B4A
iad.LoadAd
#else
iad.RequestAd
#End If
ImageView1.Bitmap = LoadBitmapResize(File.DirAssets, "logo.png", 80%x, 80%x, True)
Sleep(3000)
WebView1.LoadUrl("https://www.b4x.com")
End Sub
Sub WebView1_JSComplete (Success As Boolean, Tag As Object, Result As String)
Log("hsaudhas")
End Sub
#if B4A
Sub WebView1_PageFinished (Url As String)
#Else
Sub WebView1_PageFinished (Success As Boolean, Url As String)
#End If
bgp.Visible = False
End Sub
Sub GetErrorCodeAd(ErrorCode As String) As String
Dim str_error As String
Select ErrorCode
Case 0
str_error = "INTERNAL_ERROR" 'Something happened internally; for instance, an invalid response was received from the ad server.
Case 1
str_error = "INVALID_REQUEST" 'The ad request was invalid; for instance, the ad unit ID was incorrect.
Case 2
str_error = "NETWORK_ERROR" 'The ad request was unsuccessful due to network connectivity.
Case 3
str_error = "NO_FILL" 'The ad request was successful, but no ad was returned due to lack of ad inventory
End Select
Return ErrorCode & " - " & str_error
End Sub
#if B4A
Sub iad_AdFailedToLoad (ErrorMessage As String)
Log("iad AdFailedToLoad: " & GetErrorCodeAd(ErrorMessage))
End Sub
Sub iad_AdClosed
Log("iad AdClosed")
iadAberto = 1
'iad.LoadAd 'prepare a new ad
End Sub
Sub iad_AdLoaded
Log("mwadi2 Adloaded")
End Sub
Sub iad_ReceiveAd
Log("mwadi2 ReceiveAd")
'ToastMessageShow("Interstitial Received", False) 'show only in the example
iad.Show
End Sub
#End If
#if B4i
Sub iad_Ready (Success As Boolean)
If Success Then
Log("iad is ready.")
iad.Show(B4XPages.GetNativeParent(Me)) 'show ad
Else
Log(LastException)
End If
End Sub
#End If