Skip to main content

How to use Firebase database in Kodular?

How to use Firebase database in Kodular?

Welcome to Learn Web my friends. Today we are going to learn about how to retrieve and store data from user in firebase database. This will be surely very exciting and useful for you guys. So, here we start our tutorial on "How to store data of user in Firebase in Kodular?"

How to store data of user in Firebase in Kodular?

1. What is Firebase?

I think you guys may have listened about Firebase but if not, then don't worry this isn't any rocket science you will easily learn "How to store and retrieve data of user in Firebase?". Firstly I want to tell you about What is Firebase Database? So, firebase is a cloud storage platform provided by google to store and retrieve data and Firebase also provide many other services that we will learn in our next tutorials. Today we are going to talk about "How to use Firebase Database in Kodular?" 


2. What is Firebase database in Kodular?

Now I would like to tell you what is Firebase database and what we are going to Learn today. Simply Firebase database is same as we store data in Kodular Tiny DB. We can save string with tags to identify them but here we store data online in cloud storage. That's why we get some advantage to use Firebase database over Tiny DB that are given below:
1. User can save data from any device to his/her account.
2. User can also fetch data even after clearing data or uninstalling app.
3. We can easily identify user data.
4. Data is always most safe than saved in device.


3. What do we need to use Firebase Database?

You will be very happy to listen that Firebase Database is a completely Free service. We are thankful to google for this to allow us to use Firebase for free. So, you just need a Firebase Console account to use Firebase Database. You can Sign up for Firebase Console account from here

Go to Firebase's official Website and Click on the "Go to Console" Button on the Right Corner.

Firebase Homepage

Then you will be on your projects page, then click on create a project....

1. Now, you will see Firebase asking you to name your projects. So, just enter name of your project and check the terms and conditions and then proceed ahead.

2. Now follow the next steps shown to create your project.

Once you have created your project in Firebase successfully then open your project in Kodular Creator. Now I will tell you how to implement Firebase database in Kodular Creator Project.

How to implement Firebase database in Kodular Creator Project?

Step 1: Look for Google option in the sidebar.

Step 2: Now find Firebase Database Component under Google option.

Step 3: And drag and drop the Firebase database component in Viewer.

And now you have implemeted Firebase to your project successfully.


How to connect Firebase with app?

Once you have successfully implemented Firebase in app, then you need to add these things to store and retrieve data.....

1. Create a realtime Database:
First you need to create a realtime database to use Firebase Database in Kodular Creator's App. So, click on Develop option in sidebar and then click on Realtime Database here.

Realtime Database in Firebase


Then click on "Create Database" button to create a new database for your app.

Create new database

After clicking "Create Database" Button you will be shown a dialog asking you to set security rules for your Realtime Database; here you have to select the test option to use Firebase in Kodular.

Set up databse


Here, you have created your realtime database Successfully. Now, you have to add some values in Kodular creator Firebase Component.

1. Firebase Token:
 In properties of Firebase component on the top you can find an option to add firebase token. This is the token for your Firebase project to store and retrieve data. For getting this firebase token get to your Firebase project dashboard and click on setting icon and then click on Project setting option.

Illustration:
Project Settings

Then you will find Web API Key that is your Firebase Token:

Firebase database API key

Copy this Web API key and paste it in the Firebase token option in Kodular Creator.

2. Firebase Database URL:
Secondly you have to add a Firebase Database URL in this option to connect Firebase Database with your app. You will get the Firebase URL in your Database in Firebase Console. 

Database URL

This is the Firebase URL which you have to put in your Kodular Creator. So, add this and you have connected your app with Firebase.

3. Project Bucket:
This is the Bucket or the tag under which you want to store the data of your app. You can set different project buckets using Blocks.


How to store Data in Firebase?

For storing data string for any tag you have to set the following blocks when you want to store data.

Stores value for given tag

Here put the tag for which you want to store the value. And put the string for value to store, the value which you want to store for the above tag.

How to Retrieve value for a tag?

For getting data for any tag you need to set these blocks when you want to retrieve value for the given tag.

Retrieve value for provided tag

For this you have to set two types of blocks, First is to call Firebase DB component to get value and second is to use the value found by component. And in this way you can get the value for tag from your database in Firebase.

So, I think you might have now understood "How to use Firebase Database in Kodular?" This was our tutorial for Firebase and we will be back again tomorrow with a complete new Tutorial. 
Till then....

Happy Koding.....

Comments

Popular posts from this blog

How to use Utilities component in Kodular Creator?

  How to use Utilities component in Kodular Creator? Welcome back guys to Learn webs online. As you may have seen in above image, in today's tutorial we will be going to learn to use the utilities components in Kodular Creator. These components will surely be useful for your future projects. In today tutorial we will learn to use these four utilities components. These are the main utilities components in kodular creator. There are also another utilities components which we will learn to use in further tutorials. So, let's start our tutorial without waiting any more..... 1. Wallpaper component Introduction: This component can be found at the last position in the utilities components under utilities option in sidebar. As you can understand by it's name this is used to access the wallpaper settings of user's device. This is very useful component while developing a app in which we allow user to change or modify wallpaper within the application. This app may be a browser app...

How to use KIO4 gradient in Kodular?

  Welcome to learn web, today we are back with a completely new tutorial on Kodular Basic-to -Advanced app making.Today topic for our tutorial is that how to use Gradient effect in Kodular app making for any layout. How to use gradient colors in kodular app? For this you need to use a extension named "KIO4" gradient.So,before starting you need to get this extension before we start our tutorial.To get this click on link below: My Drive Link This is the google drive link for the KIO4 extension. I think you might have got the extension.So, we start our tutorial on how to use gradient effect Kodular apps. Step 1:Open your Project in which you want to use gradient Effect.Then click on the extensions button in the bottom of left sidebar and click on import extension.Now select the KIO4 gradient file and click on Import after some time your extension will be processed and imported to your project. Illustration: Once you have Imported the KIO4 extension you can see the extension as s...