Firbase Realtime Database with Android
How to connect Realtime database with Android Application
How to implement FirebaseRealTime database in android application. Following is the steps for do it.
First install firebase sdk, If you dont know how to install then following is the URL for help. Install Firebase SDK
After thet register your project in firbase console, URL of the firbase console is Firebase Console Url
After successfuly complet above to step add following dependency in you application level gradel. compile 'com.google.firebase:firebase-database:9.2.1'
Also one more thing configure your firebase database rules. If you dont how to configure then following is the URL which help you. Configure firebase Rules
Now after all thing done, Original code is start, First retrieve your database instance throw FirebaseDatabase like following,
FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("message");
You can now create different different object of DatabaseReference for the access different node,
Now you can save or retrieve data using DataBaseReference like following way, For the save :
myRef.setValue("Demo for Save");
Read data :
Note : This is the only introducation topic how to implement database in android application lost of more thing available in FirebaseRealtime database,