Android Question I Need Firebase Realtime Database Tutorial Step By Step

imam syaifuddin

Member
Licensed User
Longtime User
Hello, I need a firebase realtime database tutorial step by step, where can I get it ?, all the examples available in this forum cannot be running and there is an error when compiling
 

imam syaifuddin

Member
Licensed User
Longtime User
This error when compiling

B4A Version: 9.80
Java Version: 11
Parsing code. (0.04s)
Building folders structure. (0.04s)
Compiling code. (0.27s)
Compiling layouts code. (0.05s)
Organizing libraries. (0.00s)
(Android Support Library)
Generating R file. Error
AndroidManifest.xml:69: error: Error parsing XML: not well-formed (invalid token)
 
Upvote 0

imam syaifuddin

Member
Licensed User
Longtime User
This code manaifest editor


B4X:
'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$")
'End of default text.

'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************

'************ Firebase Base ************
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
  android:protectionLevel="signature" />)
AddApplicationText(
<receiver
  android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
  android:enabled="true">
  <intent-filter>
  <action android:name="com.google.android.gms.measurement.UPLOAD"/>
  </intent-filter>
  </receiver>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <provider
  android:authorities="${applicationId}.firebaseinitprovider"
  android:name="com.google.firebase.provider.FirebaseInitProvider"
  android:exported="false"
  android:initOrder="100" />
    <receiver
  android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
  android:enabled="true">
  <intent-filter>
  <action android:name="com.google.android.gms.measurement.UPLOAD"/>
  </intent-filter>
  </receiver>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
  android:exported="true"
  android:permission="com.google.android.c2dm.permission.SEND" >
  <intent-filter>
  <action android:name="com.google.android.c2dm.intent.RECEIVE" />
  <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
  <category android:name="${applicationId}"
  </intent-filter>
  </receiver>
    <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
  android:exported="false" />


  <service
  android:name="com.google.firebase.iid.FirebaseInstanceIdService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
  </intent-filter>
  </service>
)
'************ Firebase Base (end) ************

'************ Firebase Notifications ************
AddApplicationText(
    <service
  android:name="com.google.firebase.messaging.FirebaseMessagingService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.MESSAGING_EVENT" />
  </intent-filter>
  </service>
   <service android:name="anywheresoftware.b4a.objects.FirebaseNotificationsService">
     <intent-filter>
  <action android:name="com.google.firebase.MESSAGING_EVENT"/>
     </intent-filter>
   </service>
)
'************ Firebase Notifications (end)************

'************ Firebase Analytics ************
AddApplicationText(
  <receiver
  android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
  android:enabled="true">
  <intent-filter>
  <action android:name="com.google.android.gms.measurement.UPLOAD"/>
  </intent-filter>
  </receiver>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>

  <service android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
  android:process=":background_crash"/>

  <service android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
  android:process=":background_crash"/>
)
'************ Firebase Analytics (end) ************


'************ Firebase Auth ************
AddApplicationText(
  <activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:excludeFromRecents="true"
  android:exported="false" />

  <service
  android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
  android:exported="true"
  android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
)
'************ Firebase Auth (end) ************

'************ Facebook Login ****************
AddApplicationText(<activity android:name="com.facebook.FacebookActivity"
          android:configChanges=
                 "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
          android:theme="@android:style/Theme.Translucent.NoTitleBar" />
           <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)

'************ Facebook Login (end) **********

CreateResource(values, facebook.xml, <resources>
     <string name="facebook_app_id">YOUR FACEBOOK APP ID HERE</string>
    </resources>)
 
Upvote 0

imam syaifuddin

Member
Licensed User
Longtime User
I deleted Facebook login in the manifest editor but it was an error like before

Generating R file. Error
AndroidManifest.xml:69: error: Error parsing XML: not well-formed (invalid token)
 
Upvote 0

imam syaifuddin

Member
Licensed User
Longtime User
I get a tutorial when I compile I get an error

B4A Version: 9.80
Java Version: 11
Parsing code. (0.02s)
Building folders structure. (0.12s)
Compiling code. (0.08s)
Compiling layouts code. (0.01s)
Organizing libraries. Error
Maven artifact not found: com.google.firebase/firebase-database-collection

please help me complate tutorial
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…