prince_j325
Member
I made an app with Ads. Honestly this is my app developed in b4a. But I found out that the apps can be only install on android version 9 and up. Any fix for this?
This is my Manifest File
This is my code on Main Activity
This is my Manifest File
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<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.DarkTheme)
SetActivityAttribute(Main, android:screenOrientation, "portrait")
SetActivityAttribute(mdlGlobal, android:screenOrientation, "portrait")
SetActivityAttribute(mdlCountries, android:screenOrientation, "portrait")
SetActivityAttribute(mdlListCountries, android:screenOrientation, "portrait")
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddReplacement($ADMOB_APP_ID$, ca-app-pub-7449308286288394~xxxxxxxxxx)
This is my code on Main Activity
B4X:
Activity.LoadLayout("lyMain")
BannerAd.Initialize2("BannerAd", "ca-app-pub-7449308286288394/xxxxxxxxxx", 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, 45dip, 100%x, height)
BannerAd.LoadAd
IAd.Initialize("iad", "ca-app-pub-7449308286288394/xxxxxxxxxx")
IAd.LoadAd
Last edited: