'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="9" 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)
'End of default text.
'******************** orientamento **********************
SetActivityAttribute(Home, android:screenOrientation, "portrait")
' *************** imposto il thema da utilizzare ****************
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
' *************** definisco le costanti assegnate ai colori
CreateResource(values, colors.xml,
<resources>
<color name="actionbar">#018ABE</color>
<color name="statusbar">#007CF5</color>
<color name="textColorPrimary">#0000FF</color>
<color name="navigationBar">#ff006db3</color>
</resources>
)
' **************** definisco gli attributi specifici del tema
CreateResource(values, theme.xml,
<resources>
<style name="MyAppTheme" parent="@android:style/Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">@color/actionbar</item> <!-- action bar -->
<item name="android:colorPrimaryDark">@color/statusbar</item> <!-- status bar -->
<item name="android:colorAccent">#AAAA00</item> <!-- Seekbar,, checkboxes,, switches,, etc. -->
<item name="android:textColorPrimary">@color/textColorPrimary</item> <!-- ? -->
<item name="android:textColorSecondary">#6699CC</item> <!-- inactive editText line,, scrollbar -->
<item name="android:textColor">#000000</item> <!-- menu text,, msgbox title -->
<item name="android:textColorLink">#b71c1c</item>
<item name="android:textColorHighlight">#FF2424</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="MyThemeTransparent" parent="android:style/Theme.Translucent.NoTitleBar">
</style>
</resources>
)
' ************* è possibile definire configurazioni specifiche dei temi associate alle versioni ANDROID
'CreateResource(values-v20, theme.xml,
'<resources>
' <style name="LightTheme" parent="@android:style/Theme.Material.Light">
' <item name="android:colorPrimary">@color/actionbar</item>
' <item name="android:colorPrimaryDark">@color/statusbar</item>
' <item name="android:textColorPrimary">@color/textColorPrimary</item>
' <item name="android:navigationBarColor">@color/navigationBar</item>
' </style>
'</resources>
')
'SetActivityAttribute(main, android:theme, @android:style/Theme.AppCompat.Translucent.NoTitleBar)
SetActivityAttribute(main, android:theme, "@style/MyAppTheme")
'******** enable no-ssl communications
CreateResourceFromFile(Macro, Core.NetworkClearText)
'**************** Notify permission *************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseRemoteConfig.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
'************ Firebase Crashlytics *********************
AddApplicationText(
<provider
android:name="com.crashlytics.android.CrashlyticsInitProvider"
android:authorities="$PACKAGE$.crashlyticsinitprovider"
android:exported="false"
android:initOrder="100" />
)
CreateResource(values, com_crashlytics_build_id.xml,
<resources xmlns:tools="http://schemas.android.com/tools">
<string tools:ignore="UnusedResources,,TypographyDashes" name="com.crashlytics.android.build_id"
translatable="false">xxxxxx6c696e67</string>
</resources>)
' il guid va modificato per ogni RELEASE ^^^^^^^^^^^^^^^^^^^^
'************ Firebase crashlytics (end) ***************
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
' permission install
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
AddManifestText(
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />)