Subscribe to our Blog
We're committed to your privacy. SayOne uses the information you provide to us to contact you about our relevant content, products, and services. check out our privacy policy.
Real PradOctober 20, 20173 min read
Generating table of contents...
Firebase is an open source platform for building mobile and web applications. It can provide real-time data updates with great ease. Firebase stores the data in JSON format. We don't need to put any efforts in configuring the server, the Firebase will handle everything automatically and saves a big span of time and increase the productivity.
When the real-time data is updated, it stores the data in the cloud and simultaneously notifies all the connected devices within milliseconds.
Whenever the connection is lost the database STK uses a local cache on the device to serve and store changes and once the user comes back online their local data is automatically synchronized.
For security, we can specify who has the access to what piece of data. The security rules are securely stored within in real-time database on the server
ModelClass modelClassObject = new ModelClass(data 1, data 2,..);
FirebaseDatabase databaseInstanceName = FirebaseDatabase.getInstance();
databaseInstanceName.child(“new node”).setValue(modelClassObject);
This will create a child node in the database with name “new node” with data as its child.
databaseInstanceName.addValueEventListener(new ValueEventListener() { public void onDataChange(DataSnapshot snapshot) { for (DataSnapshot postSnapshot : snapshot.getChildren()) { ModelClass modelClassObject = postSnapshot.getValue(ModelClass.class); } }}
Refer the following example to create a simple chat room by using firebase.
databaseInstanceName.child(“new node”).removeValue();
This will delete the child named “new node”
For understanding how to apply this in a project, you can refer this example.
So you have seen how easy it is to set up a database and manage your data with Firebase. Firebase has many more applications.
We're committed to your privacy. SayOne uses the information you provide to us to contact you about our relevant content, products, and services. check out our privacy policy.
About Author
Co-founder and CEO at SayOne Technologies | Helping startups and enterprises to set up and scale technology teams- Python, Spring Boot, React, Angular & Mobile.
We collaborate with visionary leaders on projects that focus on quality and require the expertise of a highly-skilled and experienced team.