I am trying to add firebase cloud messaging to my project. The problem is that I would like to push up notifications when the device is sleeping or the application is in background. Firebase documentation says, that when you send notification when app is not in the foreground, system will do the job but why it works on API 26 and not on API 25 lower?
Notifications in foreground app are handled by me and it works fine, my targeted API is 26 - compiled SDK 26.0.2 and using the newest version of FCM pkg.
My testing devices are adbs with API 19,22,25,26
and Xperia X with API 25, Samsung S8 API 26
My notification JSON that I send:
{
"to" : "existing key",
"condition" : null,
"collapse_key" : null,
"priority" : "high",
"content_available" : null,
"time_to_live" : 3600,
"restricted_package_name" : null,
"dry_run" : null,
"data" : null,
"registration_ids" : null,
"notification" : {
"title" : "ViLo Testzor",
"body" : "Alarm. ",
"sound" : null,
"icon" : null,
"tag" : null,
"color" : null,
"badge" : null,
"bodyLocKey" : null,
"bodyLockArgs" : null,
"clickAction" : null,
"titleLocKey" : null,
"titleLocArgs" : null
}
}
My manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cz.pkg.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name=".android.App"
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:minSdkVersion="19"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppFullScreenTheme">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_app_icon" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel"
android:value="#string/default_notification_channel_id" />
<activity
android:name=".android.ActivityMain"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="#style/AppFullScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".android.SenzasenFirebaseInstanceIdService"
android:enabled="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name=".android.SenzasenMessagingService"
android:enabled="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".android.BackgroundWatcher"
android:enabled="true"
android:exported="true" />
<receiver
android:name=".android.notifications.BroadcastRecieverUpdater"
android:enabled="true"
android:exported="true"></receiver>
</application>
</manifest>
My gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "cz.pkg.app"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
This is log cat Firebase when notification is send:
10-05 12:25:04.444 5568-5568/? I/FA: App measurement is starting up, version: 11400
10-05 12:25:04.444 5568-5568/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
10-05 12:25:04.450 5568-5568/? V/FA: Collection enabled
10-05 12:25:04.450 5568-5568/? V/FA: App package, google app id: cz.pkg.app, 1:535056224042:android:2977b77751aa5b1f
10-05 12:25:04.451 5568-5568/? I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app cz.pkg.app
10-05 12:25:04.451 5568-5568/? D/FA: Debug-level message logging enabled
10-05 12:25:04.455 5568-5568/? V/FA: Cancelling job. JobID: 717907879
10-05 12:25:04.456 5568-5568/? V/FA: Registered activity lifecycle callback
10-05 12:25:04.464 5568-5590/? V/FA: Using measurement service
10-05 12:25:04.464 5568-5590/? V/FA: Connecting to remote service
10-05 12:25:04.471 5568-5590/? V/FA: Using measurement service
10-05 12:25:04.471 5568-5590/? V/FA: Connection attempt already in progress
10-05 12:25:04.475 5568-5568/? V/FA: onActivityCreated
10-05 12:25:04.527 5568-5590/cz.pkg.app V/FA: Using measurement service
10-05 12:25:04.527 5568-5590/cz.pkg.app V/FA: Connection attempt already in progress
10-05 12:25:04.529 5568-5590/cz.pkg.app V/FA: Activity resumed, time: 57001950
10-05 12:25:04.533 5568-5590/cz.pkg.app I/FA: Tag Manager is not found and thus will not be used
10-05 12:25:04.534 5568-5590/cz.pkg.app D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]
10-05 12:25:04.547 5568-5590/cz.pkg.app V/FA: Using measurement service
10-05 12:25:04.547 5568-5590/cz.pkg.app V/FA: Connection attempt already in progress
10-05 12:25:04.599 5568-5590/cz.pkg.app D/FA: Connected to remote service
10-05 12:25:04.599 5568-5590/cz.pkg.app V/FA: Processing queued up service tasks: 4
10-05 12:25:04.618 7477-5602/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]
10-05 12:25:04.621 7477-5602/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 57
10-05 12:25:04.622 7477-5602/? V/FA-SVC: Event recorded: Event{appId='cz.pkg.app', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]}
10-05 12:25:04.623 7477-5602/? V/FA-SVC: Upload scheduled in approximately ms: 1458892
10-05 12:25:04.625 7477-5602/? V/FA-SVC: Cancelling job. JobID: 812057698
10-05 12:25:04.625 7477-5602/? V/FA-SVC: Scheduling upload with AlarmManager
10-05 12:25:04.626 7477-5602/? V/FA-SVC: Background event processing time, ms: 8
10-05 12:25:08.146 5568-5590/cz.pkg.app V/FA: Recording user engagement, ms: 3619
10-05 12:25:08.148 5568-5590/cz.pkg.app V/FA: Activity paused, time: 57005569
10-05 12:25:08.152 5568-5590/cz.pkg.app D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=3619, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]
10-05 12:25:08.205 7477-5602/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=3619, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]
10-05 12:25:08.210 7477-5602/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67
10-05 12:25:08.210 7477-5602/? V/FA-SVC: Event recorded: Event{appId='cz.pkg.app', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=3619, firebase_screen_class(_sc)=ActivityMain, firebase_screen_id(_si)=2278851524854650625}]}
10-05 12:25:08.212 7477-5602/? V/FA-SVC: Upload scheduled in approximately ms: 1455303
10-05 12:25:08.213 7477-5602/? V/FA-SVC: Cancelling job. JobID: 812057698
10-05 12:25:08.214 7477-5602/? V/FA-SVC: Scheduling upload with AlarmManager
10-05 12:25:08.214 7477-5602/? V/FA-SVC: Background event processing time, ms: 9
10-05 12:25:15.012 5707-5707/? I/FA: App measurement is starting up, version: 11400
10-05 12:25:15.012 5707-5707/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
10-05 12:25:15.022 5707-5707/? V/FA: Collection enabled
10-05 12:25:15.022 5707-5707/? V/FA: App package, google app id: cz.pkg.app, 1:535056224042:android:2977b77751aa5b1f
10-05 12:25:15.024 5707-5707/? I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app cz.pkg.app
10-05 12:25:15.024 5707-5707/? D/FA: Debug-level message logging enabled
10-05 12:25:15.033 5707-5707/? V/FA: Cancelling job. JobID: 717907879
10-05 12:25:15.039 5707-5707/? V/FA: Registered activity lifecycle callback
10-05 12:25:15.059 5707-5726/? V/FA: Using measurement service
10-05 12:25:15.061 5707-5726/? V/FA: Connecting to remote service
10-05 12:25:15.074 5707-5726/? V/FA: Using measurement service
10-05 12:25:15.074 5707-5726/? V/FA: Connection attempt already in progress
10-05 12:25:15.078 5707-5726/? D/FA: Connected to remote service
10-05 12:25:15.079 5707-5726/? V/FA: Processing queued up service tasks: 2
10-05 12:25:20.114 5707-5726/cz.pkg.app V/FA: Inactivity, disconnecting from the service
thank you very much for every response Radek.
In your case, Firebase will not call onMessageReceived() if your app is in the background or it is in the killed state.
To get the notification in the background or in the killed state, make the use of data object instead of notification object.
Below will work:
{
"to" : "existing key",
"condition" : null,
"collapse_key" : null,
"priority" : "high",
"content_available" : null,
"time_to_live" : 3600,
"restricted_package_name" : null,
"dry_run" : null,
"data" : {
"title" : "ViLo Testzor",
"body" : "Alarm. ",
"sound" : null,
"icon" : null,
"tag" : null,
"color" : null,
"badge" : null,
"bodyLocKey" : null,
"bodyLockArgs" : null,
"clickAction" : null,
"titleLocKey" : null,
"titleLocArgs" : null
},
"registration_ids" : null,
"notification" :null
}
Add below in Manifest File
<receiver
android:name=".OnBootBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
Create OnBootBroadcastReceiver Class, and call the Firebase service.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class OnBootBroadcastReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent("Com.example.SenzasenMessagingService");
i.setClass(context, SenzasenMessagingService.class);
context.startService(i);
}
}
Related
I am in the process of setting up FirebaseUI using Google's guide but I suddenly got an error I can't seem to find a solution for. I'm pretty sure it has to do with my gradle, because I've tried commenting changes in my Java files, using my phone instead of an AVD, and other emulators to no avail. I've included what I got in the Run console, Manifest, and gradles. If you need more information, please let me know. Thanks!
EDIT: For those with the same issue, I think I fixed it by updating Google Play services on the API Q emulator (you have to sign in to Google Play first), then I added the following to the app-level gradle:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}
I don't know how it worked, but I hope it does for you too.
Run (conflicts only)
...
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
...
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
W/RenderThread: type=1400 audit(0.0:4480): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
...
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
...
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
...
W/Gralloc3: mapper 3.x is not supported
Run (full)
09/07 19:52:53: Launching 'app' on Pixel 2 API Q.
$ adb shell am start -n "com.example.litlocal/com.example.litlocal.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 14608 on device 'Pixel_2_API_Q [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/xample.litloca: The ClassLoaderContext is a special shared library.
I/xample.litloca: The ClassLoaderContext is a special shared library.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
D/OpenGLRenderer: Skia GL Pipeline
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
W/RenderThread: type=1400 audit(0.0:4449): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
V/FA: onActivityCreated
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
W/xample.litloca: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
D/: HostConnection::get() New Host Connection established 0xdc721500, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xdc7124e0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
V/FA: Collection enabled
V/FA: App package, google app id: com.example.litlocal, 1:175514927228:android:47ec351c4609ff5c6609f9
W/Gralloc3: mapper 3.x is not supported
I/FA: App measurement is starting up, version: 18202
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.litlocal
D/FA: Debug-level message logging enabled
D/: createUnique: call
D/: HostConnection::get() New Host Connection established 0xdc721640, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/xample.litloca: Background young concurrent copying GC freed 16987(4410KB) AllocSpace objects, 8(224KB) LOS objects, 78% free, 1696KB/7840KB, paused 6.401ms total 59.038ms
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 27900964
D/FA: Setting user property (FE): _sid, 1567911177
V/FA: Connection attempt already in progress
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): session_start(_s), Bundle[{ga_event_origin(_o)=auto, ga_session_id(_sid)=1567911177}]
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 27900309
D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=MainActivity, ga_screen_id(_si)=8377598752693967695}]
V/FA: Connection attempt already in progress
Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 6
V/FA: Inactivity, disconnecting from the service
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.litlocal">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="LitLocal">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CreateEventActivity"
android:label="#string/create_event_activity_name"/>
<activity
android:name=".SetEventLocationActivity"
android:label="#string/set_event_location_activity_name"/>
<activity
android:name=".LoginActivity"
android:label="#string/login_activity_name"/>
</application>
</manifest>
Gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Grade (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.litlocal"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
/*sourceCompatibility = 1.8
targetCompatibility = 1.8*/
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-firestore:21.0.0'
//implementation 'com.firebaseui:firebase-ui-database:5.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
// Tentative for login
//implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
This worked for me:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}
I am new to android development. i am trying to develop a college app, through that the admin will register users in firebase. the code is not showing any error but as i am clicking the register button the app is restarting. Help me please.
Thankyou in advance
here is my code
package com.example.abhisek.abacollege;
import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class AdminLayout extends AppCompatActivity {
private EditText SID;
private EditText SPass;
private Button AReg;
private Prog`enter code here`ressDialog progressDialog;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_layout);
final DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReferenceFromUrl("https://abacollege-2730a.firebaseio.com/STUDENTS");
progressDialog = new ProgressDialog(this);
SID = (EditText) findViewById(R.id.StID);
SPass = (EditText) findViewById(R.id.StPass);
AReg = (Button) findViewById(R.id.StRegBtn);
AReg.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
String ID = SID.getText().toString();
String Pass = SPass.getText().toString();
DatabaseReference childRef = mRootRef.child(ID);
childRef.setValue(Pass);
}
});
}
my build gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.abhisek.abacollege"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
implementation 'com.android.support:design:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-crash:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
help me please i really need it.. thank you again
CORRECTION
my log cat
03-09 21:19:00.205 2570-2629/com.example.abhisek.abacollege I/FA: Tag Manager is not found and thus will not be used
03-09 21:19:00.282 2570-2629/com.example.abhisek.abacollege D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-1484019674178325915}]
03-09 21:19:01.162 2570-2629/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:19:01.170 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:19:01.193 2570-2629/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 4
03-09 21:19:01.193 2570-2629/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send app launch
03-09 21:19:01.194 2570-2629/com.example.abhisek.abacollege E/FA: Failed to get app instance id
03-09 21:19:01.195 2570-2629/com.example.abhisek.abacollege E/FA: Failed to send current screen to service
03-09 21:19:01.202 2570-2629/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send event to service
03-09 21:19:01.214 2570-2629/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 0
03-09 21:19:11.576 2552-2808/com.google.android.gms I/FA-SVC: App measurement is starting up, version: 11580
03-09 21:19:11.632 2552-2808/com.google.android.gms V/FA-SVC: Collection enabled
03-09 21:19:11.694 2552-2808/com.google.android.gms D/FA-SVC: Debug-level message logging enabled
03-09 21:19:11.815 2552-2808/com.google.android.gms V/FA-SVC: Cancelling job. JobID: 812057698
03-09 21:19:11.916 2552-3368/com.google.android.gms I/FA-SVC: This instance being marked as an uploader
03-09 21:19:11.978 2552-3368/com.google.android.gms V/FA-SVC: Nothing to upload or uploading impossible
03-09 21:19:11.980 2552-3368/com.google.android.gms V/FA-SVC: Cancelling job. JobID: 812057698
03-09 21:19:14.769 2552-3213/com.google.android.gms D/FA-SVC: Got package replaced intent: com.example.abhisek.abacollege
03-09 21:19:15.065 2570-2609/com.example.abhisek.abacollege E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED
03-09 21:19:45.096 2570-2609/com.example.abhisek.abacollege E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED
03-09 21:20:18.939 2570-3753/com.example.abhisek.abacollege V/FA: Recording user engagement, ms: 79212
03-09 21:20:18.941 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:18.955 2570-3753/com.example.abhisek.abacollege V/FA: Activity paused, time: 150300
03-09 21:20:18.976 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=79212, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-1484019674178325915}]
03-09 21:20:19.030 2570-2570/com.example.abhisek.abacollege V/FA: onActivityCreated
03-09 21:20:19.345 2570-3753/com.example.abhisek.abacollege V/FA: Connection attempt already in progress
03-09 21:20:19.369 2570-3753/com.example.abhisek.abacollege V/FA: Connection attempt already in progress
03-09 21:20:19.370 2570-3753/com.example.abhisek.abacollege V/FA: Activity resumed, time: 150668
03-09 21:20:19.385 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:20:19.400 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=-1484019674178325915, firebase_screen_class(_sc)=AdminLogin, firebase_screen_id(_si)=-1484019674178325914}]
03-09 21:20:19.485 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:19.506 2570-3753/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 4
03-09 21:20:19.519 2570-3753/com.example.abhisek.abacollege E/FA: Failed to send current screen to service
03-09 21:20:19.530 2570-3753/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send event to service
03-09 21:20:19.531 2570-3753/com.example.abhisek.abacollege E/FA: Failed to send current screen to service
03-09 21:20:19.532 2570-3753/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send event to service
03-09 21:20:19.743 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:20:19.759 2570-3753/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 0
03-09 21:20:20.835 1774-1774/com.google.android.inputmethod.latin W/GInputConnectionWrapper: Fixing selection indices to 0, 0
03-09 21:20:24.650 1774-1774/com.google.android.inputmethod.latin W/GInputConnectionWrapper: Fixing selection indices to 0, 0
03-09 21:20:28.537 2570-3753/com.example.abhisek.abacollege V/FA: Recording user engagement, ms: 9245
03-09 21:20:28.538 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:28.542 2570-3753/com.example.abhisek.abacollege V/FA: Activity paused, time: 159912
03-09 21:20:28.551 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=9245, firebase_screen_class(_sc)=AdminLogin, firebase_screen_id(_si)=-1484019674178325914}]
03-09 21:20:28.569 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:20:28.592 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:28.600 2570-3753/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 2
03-09 21:20:28.600 2570-3753/com.example.abhisek.abacollege E/FA: Failed to send current screen to service
03-09 21:20:28.601 2570-3753/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send event to service
03-09 21:20:28.615 2570-2570/com.example.abhisek.abacollege V/FA: onActivityCreated
03-09 21:20:28.839 2570-3753/com.example.abhisek.abacollege V/FA: Connection attempt already in progress
03-09 21:20:28.839 2570-3753/com.example.abhisek.abacollege V/FA: Activity resumed, time: 160204
03-09 21:20:29.027 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=AdminLogin, firebase_previous_id(_pi)=-1484019674178325914, firebase_screen_class(_sc)=AdminLayout, firebase_screen_id(_si)=-1484019674178325913}]
03-09 21:20:29.063 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:20:29.215 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:29.237 2570-3753/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 2
03-09 21:20:29.238 2570-3753/com.example.abhisek.abacollege E/FA: Failed to send current screen to service
03-09 21:20:29.239 2570-3753/com.example.abhisek.abacollege E/FA: Discarding data. Failed to send event to service
03-09 21:20:29.477 2570-2570/com.example.abhisek.abacollege W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-09 21:20:29.494 2570-3753/com.example.abhisek.abacollege V/FA: Processing queued up service tasks: 0
03-09 21:20:30.142 1774-1774/com.google.android.inputmethod.latin W/GInputConnectionWrapper: Fixing selection indices to 0, 0
03-09 21:20:34.170 2552-2564/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/networkstatistics.sqlite' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-09 21:20:36.380 1774-1774/com.google.android.inputmethod.latin W/GInputConnectionWrapper: Fixing selection indices to 0, 0
03-09 21:20:40.580 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): app_exception(_ae), Bundle[{firebase_event_origin(_o)=crash, firebase_screen_class(_sc)=AdminLayout, firebase_screen_id(_si)=-1484019674178325913, timestamp=1520610640567, fatal=1}]
03-09 21:20:40.621 2570-3753/com.example.abhisek.abacollege V/FA: Connecting to remote service
03-09 21:20:40.625 2570-3753/com.example.abhisek.abacollege V/FA: Recording user engagement, ms: 11798
03-09 21:20:40.633 2570-3753/com.example.abhisek.abacollege D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=11798, firebase_screen_class(_sc)=AdminLayout, firebase_screen_id(_si)=-1484019674178325913}]
03-09 21:20:40.664 2570-3753/com.example.abhisek.abacollege V/FA: Connection attempt already in progress
You are creating two references, but you can simply do this
inside your onClick
mRootRef.child(ID).setValue(Pass);
Make sure that in your rules in firebase you have them set to true if you are not logged in or authenticated
I'm creating an app that requires me to read from a fire base database and this value to alter layouts. I've tried using the 'help' from android studio but when I run the program it crashes. The photo I've attached is the 'help' not as code because it crashed the program and I wanted it work basically. So can anyone advise an easier method of reading from the database?
Thanks
12-04 11:38:44.004 3524-3524/com.example.jopayne1968.points4spending I/FA: App measurement is starting up, version: 11020
12-04 11:38:44.004 3524-3524/com.example.jopayne1968.points4spending I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
12-04 11:38:44.034 3524-3524/com.example.jopayne1968.points4spending V/FA: Collection enabled
12-04 11:38:44.034 3524-3524/com.example.jopayne1968.points4spending V/FA: App package, google app id: com.example.jopayne1968.points4spending, 1:723788589244:android:e3ad2acca46870b3
12-04 11:38:44.034 3524-3524/com.example.jopayne1968.points4spending I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.jopayne1968.points4spending
12-04 11:38:44.034 3524-3524/com.example.jopayne1968.points4spending D/FA: Debug-level message logging enabled
12-04 11:38:44.104 3524-3524/com.example.jopayne1968.points4spending V/FA: Registered activity lifecycle callback
12-04 11:38:44.114 3524-3630/com.example.jopayne1968.points4spending V/FA: Using measurement service
12-04 11:38:44.114 3524-3630/com.example.jopayne1968.points4spending V/FA: Connecting to remote service
12-04 11:38:44.114 3524-3630/com.example.jopayne1968.points4spending V/FA: Connection attempt already in progress
12-04 11:38:44.264 3524-3524/com.example.jopayne1968.points4spending V/FA: onActivityCreated
12-04 11:38:44.514 3524-3630/com.example.jopayne1968.points4spending V/FA: Using measurement service
12-04 11:38:44.514 3524-3630/com.example.jopayne1968.points4spending V/FA: Connection attempt already in progress
12-04 11:38:44.514 3524-3630/com.example.jopayne1968.points4spending V/FA: Activity resumed, time: 60750091
12-04 11:38:44.514 3524-3630/com.example.jopayne1968.points4spending I/FA: Tag Manager is not found and thus will not be used
12-04 11:38:44.514 3524-3630/com.example.jopayne1968.points4spending D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SignUpActivity, firebase_screen_id(_si)=531904640859358265}]
12-04 11:38:44.544 3524-3630/com.example.jopayne1968.points4spending V/FA: Using measurement service
12-04 11:38:44.544 3524-3630/com.example.jopayne1968.points4spending V/FA: Connection attempt already in progress
12-04 11:38:44.744 3524-3630/com.example.jopayne1968.points4spending D/FA: Connected to remote service
12-04 11:38:44.744 3524-3630/com.example.jopayne1968.points4spending V/FA: Processing queued up service tasks: 4
12-04 11:38:44.794 3422-2815/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SignUpActivity, firebase_screen_id(_si)=531904640859358265}]
12-04 11:38:44.804 3422-2815/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 59
12-04 11:38:44.804 3422-2815/? V/FA-SVC: Event recorded: Event{appId='com.example.jopayne1968.points4spending', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SignUpActivity, firebase_screen_id(_si)=531904640859358265}]}
12-04 11:38:44.814 3422-2815/? V/FA-SVC: Upload scheduled in approximately ms: 3418911
12-04 11:38:44.814 3422-2815/? V/FA-SVC: Scheduling upload with GcmTaskService
12-04 11:38:44.814 3422-2815/? V/FA-SVC: Scheduling task with Gcm. Time3418911
12-04 11:38:44.824 3422-2815/? V/FA-SVC: Background event processing time, ms: 28
12-04 11:38:49.854 3524-3630/com.example.jopayne1968.points4spending V/FA: Inactivity, disconnecting from the service
While running the demo (https://github.com/androidthings/doorbell) on my respberry PI, I run into error like the following:
01-01 00:11:00.830 5672-5672/com.company.androidthings.doorbell I/CameraManagerGlobal: Connecting to camera service
01-01 00:11:00.835 5672-5672/com.company.androidthings.doorbell D/DoorbellCamera: Using camera id 0
01-01 00:11:00.853 5672-5723/com.company.androidthings.doorbell D/DoorbellCamera: Opened camera.
01-01 00:11:00.995 5672-5715/com.company.androidthings.doorbell I/FA: This instance being marked as an uploader
01-01 00:11:01.122 5672-5715/com.company.androidthings.doorbell D/FA: Unable to get advertising id: com.google.android.gms.common.GooglePlayServicesNotAvailableException: com.google.android.gms.measurement.internal.zzt.zzlx(Unknown Source)
01-01 00:11:01.253 5672-5732/com.company.androidthings.doorbell D/FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 10s
The following is the method I tried:
I did some research and find the following relevant post:
adjust/unity_sdk#88
Following the instruction to install play service with android SDK manage tool (using android studio). Clear the project. Rebuild. Install the new apk into respberry PI but still have the same error log.
I also checked on the firebase console, no picture was updated. Even from the android monitor, it was confirmed that button was pushed camera works as expected.
Regarding internet connection, I installed another app on the raspberry PI. It successfully sent the info to the server. It confirms the connectivity works as expected.
Any suggestion?
The log message you are seeing is from FirebaseAnalytics (the "FA" in the log tag), and makes sense since analytics is not enabled in this sample (unless you added code to enable it). Notice this is also a debug message (the "D" in the log tag) and not an error/warning.
This should not be affecting the Doorbell sample, so if you are not able to get the images uploaded properly to Firebase there is likely something else wrong with the project configuration and perhaps there are other clues deeper in the log.
It turns out that configuration is not appropriate. It uses the new SDK path which doesn't install google play service. Once I switch to the default SDK path of system which installed google play service. The logs looks different event though that message "Unable to get advertising id:" is still there. It seems (from FA log) the app can talk to the server.
04-24 15:22:53.659 16642-16642/? I/art: Late-enabling -Xcheck:jni
04-24 15:22:53.661 16642-16642/? W/art: Unknown instruction set features for ARM CPU variant (generic) using conservative defaults
04-24 15:22:53.709 16642-16649/? I/art: Debugger is no longer active
04-24 15:22:53.709 16642-16649/? I/art: Starting a blocking GC Instrumentation
04-24 15:22:54.610 16642-16642/? W/System: ClassLoader referenced unknown path: /data/app/com.company.androidthings.doorbell-1/lib/arm
04-24 15:22:54.678 16642-16642/com.company.androidthings.doorbell D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
04-24 15:22:54.712 16642-16642/com.company.androidthings.doorbell W/InstanceID/Rpc: Found 10007
04-24 15:22:54.723 16642-16642/com.company.androidthings.doorbell D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
04-24 15:22:54.812 16642-16642/com.company.androidthings.doorbell I/FA: App measurement is starting up, version: 9452
04-24 15:22:54.812 16642-16642/com.company.androidthings.doorbell I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
04-24 15:22:54.812 16642-16642/com.company.androidthings.doorbell D/FA: Debug logging enabled
04-24 15:22:54.812 16642-16642/com.company.androidthings.doorbell D/FA: AppMeasurement singleton hash: 202124672
04-24 15:22:54.906 16642-16642/com.company.androidthings.doorbell V/FA: Collection enabled
04-24 15:22:54.907 16642-16642/com.company.androidthings.doorbell V/FA: App package, google app id: com.company.androidthings.doorbell, 1:821276198771:android:044f9c86291658f3
04-24 15:22:54.980 16642-16642/com.company.androidthings.doorbell V/FA: Registered activity lifecycle callback
04-24 15:22:54.986 16642-16642/com.company.androidthings.doorbell I/FirebaseInitProvider: FirebaseApp initialization successful
04-24 15:22:54.989 16642-16642/com.company.androidthings.doorbell I/InstantRun: starting instant run server: is main process
04-24 15:22:55.000 16642-16666/com.company.androidthings.doorbell V/FA: State of service unknown
04-24 15:22:55.000 16642-16666/com.company.androidthings.doorbell V/FA: Checking service availability
04-24 15:22:55.015 16642-16666/com.company.androidthings.doorbell W/GooglePlayServicesUtil: Google Play Store is missing.
04-24 15:22:55.015 16642-16666/com.company.androidthings.doorbell W/FA: Service invalid
04-24 15:22:55.016 16642-16666/com.company.androidthings.doorbell V/FA: Setting useService: false
04-24 15:22:55.019 16642-16666/com.company.androidthings.doorbell V/FA: Using local app measurement service
04-24 15:22:55.449 16642-16642/com.company.androidthings.doorbell V/FA: onActivityCreated
04-24 15:22:55.449 16642-16642/com.company.androidthings.doorbell D/DoorbellActivity: Doorbell Activity created.
04-24 15:22:55.450 16642-16642/com.company.androidthings.doorbell D/DoorbellActivity: No permission
04-24 15:22:55.502 16642-16666/com.company.androidthings.doorbell V/FA: Activity resumed, time: 331914987
04-24 15:22:55.530 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is starting up
04-24 15:22:55.563 16642-16642/com.company.androidthings.doorbell V/FA: Bound to IMeasurementService interface
04-24 15:22:55.565 16642-16666/com.company.androidthings.doorbell V/FA: Connected to service
04-24 15:22:55.566 16642-16666/com.company.androidthings.doorbell V/FA: Processing queued up service tasks: 1
04-24 15:22:59.196 16642-16666/com.company.androidthings.doorbell W/art: Long monitor contention with owner pool-2-thread-1 (16678) at long com.android.org.conscrypt.NativeCrypto.RSA_generate_key_ex(int, byte[])(NativeCrypto.java:-2) waiters=0 in java.lang.String com.google.firebase.iid.zzg.get(java.lang.String, java.lang.String) for 3.621s
04-24 15:22:59.236 16642-16666/com.company.androidthings.doorbell I/FA: This instance being marked as an uploader
04-24 15:22:59.696 16642-16666/com.company.androidthings.doorbell D/FA: Unable to get advertising id: com.google.android.gms.common.GooglePlayServicesNotAvailableException: com.google.android.gms.measurement.internal.zzt.zzlx(Unknown Source)
04-24 15:22:59.711 16642-16666/com.company.androidthings.doorbell D/FA: Setting user property: _fot, 1493049600000
04-24 15:22:59.719 16642-16666/com.company.androidthings.doorbell D/FA: User property set: _fot, 1493049600000
04-24 15:22:59.723 16642-16666/com.company.androidthings.doorbell V/FA: Logging event: origin=auto,name=_f,params=Bundle[{_c=1}]
04-24 15:22:59.790 16642-16666/com.company.androidthings.doorbell V/FA: Saving event, name, data size: _f, 22
04-24 15:22:59.792 16642-16666/com.company.androidthings.doorbell V/FA: Event recorded: Event{appId='com.company.androidthings.doorbell', name='_f', params=Bundle[{_c=1, _o=auto}]}
04-24 15:22:59.802 16642-16666/com.company.androidthings.doorbell V/FA: Upload scheduled in approximately ms: 14436
04-24 15:22:59.807 16642-16666/com.company.androidthings.doorbell V/FA: Background event processing time, ms: 84
04-24 15:22:59.808 16642-16666/com.company.androidthings.doorbell V/FA: Logging event: origin=auto,name=_e,params=Bundle[{_et=1}]
04-24 15:22:59.840 16642-16666/com.company.androidthings.doorbell V/FA: Saving event, name, data size: _e, 23
04-24 15:22:59.841 16642-16666/com.company.androidthings.doorbell V/FA: Event recorded: Event{appId='com.company.androidthings.doorbell', name='_e', params=Bundle[{_o=auto, _et=1}]}
04-24 15:22:59.847 16642-16666/com.company.androidthings.doorbell V/FA: Upload scheduled in approximately ms: 14390
04-24 15:22:59.853 16642-16666/com.company.androidthings.doorbell V/FA: Background event processing time, ms: 45
04-24 15:23:04.241 16642-16666/com.company.androidthings.doorbell V/FA: Inactivity, disconnecting from AppMeasurementService
04-24 15:23:04.276 16642-16642/com.company.androidthings.doorbell V/FA: onUnbind called for intent. action: com.google.android.gms.measurement.START
04-24 15:23:04.277 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is shutting down
04-24 15:23:05.504 16642-16666/com.company.androidthings.doorbell V/FA: Session started, time: 331924989
04-24 15:23:05.550 16642-16666/com.company.androidthings.doorbell I/FA: Tag Manager is not found and thus will not be used
04-24 15:23:05.552 16642-16666/com.company.androidthings.doorbell D/FA: Logging event (FE): _s, Bundle[{_o=auto}]
04-24 15:23:05.555 16642-16666/com.company.androidthings.doorbell V/FA: Using local app measurement service
04-24 15:23:05.562 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is starting up
04-24 15:23:05.564 16642-16642/com.company.androidthings.doorbell V/FA: Bound to IMeasurementService interface
04-24 15:23:05.564 16642-16666/com.company.androidthings.doorbell V/FA: Connected to service
04-24 15:23:05.565 16642-16666/com.company.androidthings.doorbell V/FA: Processing queued up service tasks: 1
04-24 15:23:05.572 16642-16666/com.company.androidthings.doorbell V/FA: Logging event: origin=auto,name=_s,params=Bundle[{_o=auto}]
04-24 15:23:05.594 16642-16666/com.company.androidthings.doorbell V/FA: Saving event, name, data size: _s, 14
04-24 15:23:05.596 16642-16666/com.company.androidthings.doorbell V/FA: Event recorded: Event{appId='com.company.androidthings.doorbell', name='_s', params=Bundle[{_o=auto}]}
04-24 15:23:05.655 16642-16666/com.company.androidthings.doorbell V/FA: Upload scheduled in approximately ms: 14850
04-24 15:23:05.660 16642-16666/com.company.androidthings.doorbell V/FA: Background event processing time, ms: 89
04-24 15:23:10.577 16642-16666/com.company.androidthings.doorbell V/FA: Inactivity, disconnecting from AppMeasurementService
04-24 15:23:10.616 16642-16642/com.company.androidthings.doorbell V/FA: onUnbind called for intent. action: com.google.android.gms.measurement.START
04-24 15:23:10.618 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is shutting down
04-24 15:23:20.547 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementReceiver got: com.google.android.gms.measurement.UPLOAD
04-24 15:23:20.562 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is starting up
04-24 15:23:20.564 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService called. startId, action: 1, com.google.android.gms.measurement.UPLOAD
04-24 15:23:20.588 16642-16666/com.company.androidthings.doorbell V/FA: Fetching remote configuration: com.company.androidthings.doorbell
04-24 15:23:20.598 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService processed last upload request
04-24 15:23:20.598 16642-16642/com.company.androidthings.doorbell V/FA: Local AppMeasurementService is shutting down
04-24 15:23:20.601 16642-17004/com.company.androidthings.doorbell D/NetworkSecurityConfig: No Network Security Config specified, using platform default
04-24 15:23:21.835 16642-16666/com.company.androidthings.doorbell V/FA: Parsed config. version, gmp_app_id: 1492543680583000, 1:821276198771:android:044f9c86291658f3
04-24 15:23:21.841 16642-16666/com.company.androidthings.doorbell V/FA: Successfully fetched config. Got network response. code, size: 200, 52
04-24 15:23:21.892 16642-16666/com.company.androidthings.doorbell V/FA: event, affected audience count: _f, 0
04-24 15:23:21.896 16642-16666/com.company.androidthings.doorbell V/FA: event, affected audience count: _e, 0
04-24 15:23:21.899 16642-16666/com.company.androidthings.doorbell V/FA: event, affected audience count: _s, 0
04-24 15:23:21.901 16642-16666/com.company.androidthings.doorbell V/FA: property, affected audience count: _fot, 0
04-24 15:23:21.924 16642-16666/com.company.androidthings.doorbell V/FA: Saving bundle, size: 301
04-24 15:23:21.947 16642-16666/com.company.androidthings.doorbell V/FA: Uploading data. app, uncompressed size, data: com.company.androidthings.doorbell, 356,
batch {
bundle {
protocol_version: 1
platform: android
gmp_version: 9452
uploading_gmp_version: 9452
gmp_app_id: 1:821276198771:android:044f9c86291658f3
app_id: com.company.androidthings.doorbell
app_version: 1.0
app_version_major: 1
firebase_instance_id: eNnLI0cB484
dev_cert_hash: -8029454304837808102
app_store: manual_install
upload_timestamp_millis: 1493047401878
start_timestamp_millis: 1493047379237
end_timestamp_millis: 1493047385505
app_instance_id: 570e158a1616db1ea428bad0ac67c079
os_version: 7.0
device_model: iot_rpi3
user_default_language: en-us
time_zone_offset_minutes: 0
bundle_sequential_index: 1
service_upload: false
user_property {
set_timestamp_millis: 1493047379237
name: _fot
int_value: 1493049600000
}
event {
name: _f
timestamp_millis: 1493047379237
previous_timestamp_millis: 0
param {
name: _c
int_value: 1
}
param {
name: _o
string_value: auto
}
}
event {
name: _e
timestamp_millis: 1493047379237
previous_timestamp_millis: 0
param {
name: _o
string_value: auto
}
param {
name: _et
int_value: 1
}
}
event {
name: _s
timestamp_millis: 1493047385505
previous_timestamp_millis: 0
param {
name: _o
string_value: auto
}
}
}
}
04-24 15:23:21.950 16642-17004/com.company.androidthings.doorbell V/FA: Uploading data. size: 315
04-24 15:23:22.025 16642-16666/com.company.androidthings.doorbell V/FA: Upload scheduled in approximately ms: 3599959
04-24 15:23:22.030 16642-16666/com.company.androidthings.doorbell V/FA: Successful upload. Got network response. code, size: 204, 0
I have integrated Firebase Analytics in my app and enabled logcat. When sending log event, I got these message:
09-16 12:29:52.254 7233-7264 D/FA: Logging event (FE): add_payment_info, Bundle[{achievement_id=112, _o=app}]
09-16 12:29:52.255 7233-7264 V/FA: Using measurement service
09-16 12:29:52.255 7233-7264 V/FA: Connecting to remote service
09-16 12:29:52.259 7233-7264 V/FA: Activity paused, time: 44850636
09-16 12:29:52.282 7233-7264 D/FA: Connected to remote service
09-16 12:29:52.282 7233-7264 V/FA: Processing queued up service tasks: 1
09-16 12:29:53.259 7233-7264 D/FA: Application backgrounded. Logging engagement
09-16 12:29:53.263 7233-7264 D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=1853}]
09-16 12:29:58.271 7233-7264 V/FA: Inactivity, disconnecting from AppMeasurementService
According to this question: Firbase analytics are not apearing in the dashboard, I think this line "Logging event (FE): _e, Bundle[{_o=auto, _et=1853}]" means the event is not logged successfully. How to make it work? Thanks.
To close this question: this is not an error log. A few hours after deploying, the log info showed up.