Sub MobileAdsInitialize As ResumableSub
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim jo As JavaObject
jo.InitializeStatic("com.google.android.gms.ads.MobileAds")
Dim CompleteListener As Object = jo.CreateEventFromUI("com.google.android.gms.ads.initialization.OnInitializationCompleteListener", "Complete", Null)
jo.RunMethod("initialize", Array(ctxt, CompleteListener))
Wait For Complete_Event (MethodName As String, Args() As Object)
If MethodName = "onInitializationComplete" Then
Dim jStatusMap As JavaObject = jo.RunMethodJO("getInitializationStatus", Null).RunMethod("getAdapterStatusMap", Null)
Dim status As Map = JavaMapToB4AMap(jStatusMap)
For Each AdapterName As String In status.Keys
Dim st As JavaObject = status.Get(AdapterName)
Log($"${AdapterName}: state: ${st.RunMethod("getInitializationState", Null)}"$)
Next
End If
Return True
End Sub