Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
Sleep(0)
Service.StopAutomaticForeground 'remove if not using B4A v8+.
End Sub
'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" />)
'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="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.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
'CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
no utente
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
Inizio Service Start
firebasemessaging_subscribetotopics (java line: 268)
java.lang.RuntimeException: Object should first be initialized (FirebaseMessaging).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at it.xxx.appmobile.firebasemessaging._subscribetotopics(firebasemessaging.java:268)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1179)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
<meta-data
android:name="com.google.firebase.components:com.google.firebase.storage.StorageRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
android:name="com.google.firebase.components:com.google.firebase.firestore.FirestoreRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar"/>
<meta-data
android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar"/>
<meta-data
android:name="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?