Hello to all! I have been Using google firebase with my android apps for more than 2 years. Today while developing a new app I am facing a weird problem. I set up my firebase project on Google firebase Console successfully. I write the code to push data on firebase successfully. But the problem is that No data inserted in firebase and no Error occurs in the console. I searched online a lot but all in vain. I am pasting Screen shot of my firebase console, database rules and my source code. Kindly guide me.
database = FirebaseDatabase.getInstance();
dealer_ref = database.getReference("reg_requests");
btnSignup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Dealer dealer = new Dealer();
dealer.setId(ed.getText().toString());
dealer.setMac(getMacAddress(LoginActivity.this));
dealer.setRegistered("no");
String id = dealer_ref.push().getKey();
dealer_ref.push().setValue(dealer);
}
});
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Based on the code you’ve shared, it seems like you are using Firebase correctly. If there is no data being inserted into Firebase and no error occurs, it could be an issue related to network connectivity, Firebase rules, Firebase version, or Google Play services on the testing device.
I’d recommend checking the connectivity, updating Firebase to the latest version, and ensuring that Google Play services are updated and working on your test device. Moreover, it’s also good to verify if your Firebase rules allow data to write by checking your rules in the Firebase console.
Though, for more specific help with Firebase, I suggest you look into the Firebase Documentation or reach out to Firebase support.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.