'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
'AdMob
AddApplicationText(
<meta-data android:name="com.google.android.gms.version"
android:value="[USER=21225]@Integer[/USER]/google_play_services_version"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'AdMob
AddApplicationText(
<meta-data
android:name="com.google.android.gms.ads.ca-app-pub-7920067095036570~8669178654"
android:value="ca-app-pub-7920067095036570~8669178654"/>
)
'power by milad biroonvand
[B]step3: Follow the instructions of the specific libraries. (check use firebaseadmob v1.6)[/B]
[CODE lang="b4x" title="b4acode"]Sub Process_Globals
End Sub
Sub Globals
Private BannerAd As AdView
Private IAd As InterstitialAd
End Sub
Sub Activity_Create(FirstTime As Boolean)
BannerAd.Initialize2("BannerAd", "ca-app-pub-3940256099942544/6300978111", BannerAd.SIZE_SMART_BANNER)
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
'tablets
height = 90dip
End If
Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
BannerAd.LoadAd
IAd.Initialize("iad", "ca-app-pub-3940256099942544/1033173712")
IAd.LoadAd
End Sub
Sub Activity_Click
If IAd.Ready Then IAd.Show
End Sub
Sub IAD_AdClosed
IAd.LoadAd 'prepare a new ad
End Sub