Dim ctxt As JavaObject
ctxt.InitializeContext
Dim builder As JavaObject
builder.InitializeNewInstance("com.google.android.gms.ads.AdLoader.Builder", Array(ctxt, AdUnitId))
Dim OnContentAdLoadedListener As Object = builder.CreateEventFromUI("com/google/android/gms/ads/formats/NativeContentAd.OnContentAdLoadedListener".Replace("/", "."), _
"ContentAdLoaded", Null)
builder.RunMethod("forContentAd", Array(OnContentAdLoadedListener))
Dim adreqb As AdRequestBuilder=builder '!!!!!!!!!!!
adreqb.NonPersonalizedAds '!!!!!!!!!!!
Dim Listener As JavaObject
Listener.InitializeNewInstance(Application.PackageName & ".main$MyAdListener", Array("NativeAd")) 'change 'main' with the current activity module name
builder.RunMethod("withAdListener", Array(Listener))
Dim AdLoader As JavaObject = builder.RunMethod("build", Null)
Dim AdRequestBuilder As JavaObject
AdRequestBuilder.InitializeNewInstance("com/google/android/gms/ads/AdRequest.Builder".Replace("/", "."), Null)
AdLoader.RunMethod("loadAd", Array(AdRequestBuilder.RunMethod("build", Null)))
Wait For ContentAdLoaded_Event (MethodName As String, Args() As Object)