I'm working with Firebase on Android Studio recently , i was following the guide to insert data to Firebase Realtime Data but it seems to be not working eventhough i tried many ways to find out the error. So please help me . My app just really simple , just register , sign in , signout . I got my Register and Sign in / Signout working perfectly with Firebase. Then i move on : I added example code under
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
in the MainActivity so it will send this every time i open the app ( just to test )
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("messages");
myRef.setValue("Hello, World!");
It never work, enter image description here
I also tried reimport my gooogle-services.json file after set-up the Realtime Database but it not work too. Please tell me where did i make mistake and why i can login/register normally but i can't send the data to database . Many thanks.