I created a project and add my app to it recently. I'm already set Rule: Read and Write to true and tried a simple code to add new Value to Real Time Database console. But nothing happened. The console didn't get anything.
Here is the code i use;
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference ref = database.getReference("Bob");
ref.setValue(editText.getText.toString);
I did try ref.addValueEventListener
and in onDataChange
is textView.setText(snapshot.getValue(String.class));
The textView changes everytime I send data, even when i turn off the Wifi. Is it a problem lol?
Then I created a whole new application and tried the same code, it worked very well. But i can't leave the old app to move to the new one because i have developed it for months.
I tried to copy 2 gradle file, manifest.xml from the old one to the new one. But the new one still work.
I also tried to remove and create new Firebase project, remove Firebase from the app and add to it again.
Has anyone ever been in this situation like me?