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 Blocks in Text section in Kodular Creator?

How to use Blocks in Text section in Kodular Creator?  Guys welcome back to Learn Web Online, Today as you have seen we will be learning about using the main text related blocks. These text blocks are very useful while making your android application. We can edit, trim, join etc. text using the blocks which we will be talking about. The blocks which we will be learning to use today can be found under the built in components 'Text'. So, open your project to get live results to try these blocks your own. Here we start our tutorial without wasting time any more.... Blocks In text section Here, we have the main blocks which we are going to learn to use today's tutorial 1. Text Block: This block is used to denote a text string. This is the basic block which provide a text string in block section. We can use this block to give a text string to any other block. For example we can enter a text and set this text to a specific Label's text. 2. Join Text This block is used to join...

How to improve UI and UX of your android application?

  How to improve UI and UX of your android application? Koders, you are welcomed to Learn web online. So, as you have seen today we will be learning How we can Improve UI of our applications make in Kodular creator. Today, I will be sharing my own methods that I prefer using to Improve UI of my android applications. Before we start our tutorial I want to tell you if you are new to Learn Web online then Keep connected with us for getting more interesting tutorials related to Kodular application development. But firstly we would talk about why is a better UI important for our applications. Here are the main things which proves the importance of a better UI in Kodular Crerator ; 1. More Downloads: If the UI of your application is good then it will surely help you to get more downloads in play store. Users will get attracted by the screenshots which you provided to app store if they shows a good UI design. 2. Better engagement:  A better app UI design will help you to get more use...

How to add Google Voice Search in Kodular Creator?

  So guys today we are going to learn about Kodular components. Today we will be discussing how to use Voice search in Kodular. Now, here we start our tutorial. How to add Google Voice Search in Kodular Creator? What is Google Voice Search? Google voice search is a function in which we can search in our device by speaking our query rather than typing it to search. You may have used it manny time but today We are going to learn how to implement this our android app. Why should we use it? We can use voice to text option for many tasks such as, 1. In browser for Search option. 2. For getting voice message. 3. For use of translation etc. So,these were the some of uses of voice to text option. You guys can use this anywhere you feel need of voice input from user. How to implement this in our app?  Step 1: Firstly you need to check for speech recognizer component under the option of media in sidebar. Properties: We don't have any properties options for speech recognizer currently in...