?>

Firebase Realtime Database + Firebase Realtime Database Integrations

Appy Pie Connect allows you to automate multiple workflows between Firebase Realtime Database and Firebase Realtime Database

About Firebase Realtime Database

Realtime Database Stores and sync app data in milliseconds

Firebase Realtime Database Alternatives

Connect the apps you use everyday and find your productivity super-powers.

  • Caspio Cloud Database Caspio Cloud Database
  • MySQL MySQL
  • RethinkDB RethinkDB
Connect Firebase Realtime Database + Firebase Realtime Database in easier way

It's easy to connect Firebase Realtime Database + Firebase Realtime Database without coding knowledge. Start creating your own business flow.

    Triggers
  • Edit or Updated Child Object in Firebase Realtime Database

    Triggers on updation of a child object in firebase realtime database.

  • New Child Object in a Firebase Realtime Database

    New Child Object in a Firebase Realtime Database

    Actions
  • Create or Replace Firebase Realtime Database Record

    Creates or replaces a child object within your Firebase Realtime Database.

How Firebase Realtime Database & Firebase Realtime Database Integrations Work

  1. Step 1: Choose Firebase Realtime Database as a trigger app and Select "Trigger" from the Triggers List.

    (30 seconds)

  2. Step 2: Authenticate Firebase Realtime Database with Appy Pie Connect.

    (10 seconds)

  3. Step 3: Select Firebase Realtime Database as an action app.

    (30 seconds)

  4. Step 4: Pick desired action for the selected trigger.

    (10 seconds)

  5. Step 5: Authenticate Firebase Realtime Database with Appy Pie Connect.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of Firebase Realtime Database and Firebase Realtime Database

Firebase Realtime Database

Firebase Realtime Database is a cloud-hosted database. It allows us to store data in the cloud and sync it across multiple clients (Android, IOS, web, etc.. We can use our Firebase free account for storing up to 10GB of data. We can also have unlimited storage for $0.015 per GB per month.

Firebase Realtime Database

Firebase Realtime Database is a cloud-hosted database. It allows us to store data in the cloud and sync it across multiple clients (Android, IOS, web, etc.. We can use our Firebase free account for storing up to 10GB of data. We can also have unlimited storage for $0.015 per GB per month.

Integration of Firebase Realtime Database and Firebase Realtime Database

We can use Firebase SDK to connect to Firebase database. Here are steps to integrate with Firebase database.

Step 1. Create a new project on Firebase conspe.

Step 2. Add Firebase SDK library to your app build.gradle file.

repositories { maven { url "https://maven.google.com" } } // Add this line at the end of the file dependencies { // Add this line compile 'com.google.firebase:firebase-core:9.8.0' } 1 2 3 4 5 6 7 8 9 repositories { maven { url "https://maven.google.com" } } // Add this line at the end of the file dependencies { // Add this line compile 'com.google.firebase:firebase-core:9.8.0' }

Step 3. Initialize Firebase in your Activity or Fragment class. We need to pass Context as parameter for Firebase initialization.

protected void onCreate(Bundle savedInstanceState. { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // initialize fire base here with your context defined earlier } 1 2 3 4 5 6 protected void onCreate ( Bundle savedInstanceState . { super . onCreate ( savedInstanceState . ; setContentView ( R . layout . activity_main . ; // initialize fire base here with your context defined earlier }

Step 4. Create a new reference to the Firebase database by calling FirebaseDatabase’s getInstance(. method. Then create or update your database reference by calling the method createReference(. . This method will return you an instance of DatabaseReference . When creating a reference, you can set what kind of reference you want to create using addChild(. method. In addChild(), you can add a child using addChildAt(. method or add a child using addValueReference(. method which doesn’t require indexing order since values are ordered arbitrarily in cplection nodes.

FirebaseDatabase db = FirebaseDatabase.getInstance(); DatabaseReference ref = db.getReference("your-database-name"); ref.addChild("child", newValue); 1 2 3 FirebaseDatabase db = FirebaseDatabase . getInstance ( . ; DatabaseReference ref = db . getReference ( "your-database-name" . ; ref . addChild ( "child" , newValue . ;

Step 5. To get a reference from a node, simply call the getValue(. method from your reference object, passing in the key of the node that you want to get from the database, and it will return you a value object from it. If you would like to retrieve a list of values from a node, you can call the getValue(. method from a reference object, passing in the key of the node that you want to get from the database, and it will return you a list of value objects from it. If you would like to retrieve a list of values from a node, you can call the getChildren(. method from your reference object, passing in the key of the node that you want to get from the database, and it will return you a list of child nodes that exist under that parent node in your database tree. You can then start navigating that tree by calling getChild(. and getNextSibling(. methods on your child nodes. All of these methods work in much the same way as their counterparts in Node, except that they simply return null if there are no more children or siblings once they reach the bottom or end of the tree, respectively. The fplowing example shows how we can access node values and child nodes using their keys:

// Get single value using its unique key String valueString = ref .getValue("Panda"); // Get list of values using its unique key List<String> valueList = ref .getValues("Panda"); // Get all child nodes for this node List<Object> childNodeList = ref .getChild("Panda"); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // Get single value using its unique key String valueString = ref . getValue ( "Panda" . ; // Get list of values using its unique key List <String> valueList = ref . getValues ( "Panda" . ; // Get all child nodes for this node List <Object> childNodeList = ref . getChild ( "Panda" . ;

You can also update entire node with some pieces of new data by passing in some pieces of new data into put(. You can also update some pieces of new data into existing node by passing in some pieces of data into updateChildren(. Both of them are pretty similar in operation except that put(. works more like replace while updateChildren(. works more like merge with some pieces of new data automatically added into some pieces of new data automatically added into existing data automatically added into existing data after updating existing node with some pieces of new data before deleting existing node after updating existing node with some pieces of new data before deleting existing node :] The fplowing example shows how we can update entire node with some pieces of new data by passing in some pieces of new data into put():

// Update entire node with some pieces of new data by passing in some pieces of new data into put(. ref .put("Panda", "new text"); 1 2 3 // Update entire node with some pieces of new data by passing in some pieces of new data into put(. ref . put ( "Panda" , "new text" . ;

You can also update some pieces of new data into existing node by passing in some pieces of data into updateChildren(. Both of them are pretty similar in operation except that put(. works more like replace while updateChildren(. works more like merge with some pieces of new data automatically added into existing node after updating existing node with some pieces of new data before deleting existing node after updating existing node with some pieces of new data before deleting existing node :] The fplowing example shows how we can update some pieces of new data into existing node by passing in some pieces of data into updateChildren():

// Update some pieces of new data into existing node by passing in some pieces of data into updateChildren(. String[] // update existing node with some pieces of new data before deleting existing node :] String[] values = {"new text", "new text2"}; ref .updateChildren("Panda", values); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 // Update some pieces of new data into existing node by passing in some pieces of data into updateChildren(. String [ ] // update existing node with some pieces of new data before deleting existing node :] String [ ] values = { "new text" , "new text2" } ; ref . updateChildren ( "Panda" , values . ;

Step 6. Read/Delete Data From Database Reference Using Value Object Listener Interface(Void Method. You can listen to changes happening on any node inside your database by adding an OnDataChangeListener to it, which gives you an implementation for “NodeValueChangedListener” interface which contains one callback method called onSnapshotChanged(. You will be presented with two main parameters passed into this method, first one will be instance reference to child item changed and second parameter is snapshot object containing previous state which was changed to current state :] This snapshot object contains “key” and “value” fields which will tell us about key name and value changes happened to it :] This snapshot object contains “key” and “value” fields which will tell us about key name and value changes happened to

The process to integrate Firebase Realtime Database and Firebase Realtime Database may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.