How to use firebase for website.? How to use firebase for android.? How to insert data in firebase.?

Hello friends,

The time I am typing this post just 5 min. before I have resolved this or understood this.

So, As you are new to firebase or beginner then you need to know some of basic things.

1.Firebase is not SQL database
2.There is no query to insert data in firebase.
3.Firebase store data in tree structure there are nodes and child nodes.

Steps to follow for easy start
1.Login Firebase
2.Click Go to console
3.Create new project
4.Give any name to project
5.Click setting icon on right of Project overview
6.Choose IOS or ANDROID or Website for which you are using firebase

For website you need to include following sample details in website head section
Note:- your-project-name is here to show you sample details
<head>
<script>
var config = {
    apiKey: "AIzaSyC5V6O48uU3wM2A1eeHzVKW_IfZWrO7X3s",
    authDomain: "your-project-name.firebaseapp.com",
    databaseURL: "https://your-project-name.firebaseio.com",
    projectId: "your-project-name",
    storageBucket: "your-project-name.appspot.com", 
    messagingSenderId: "3186427xxxx"
  };
  firebase.initializeApp(config); 

</script>
</head> 

---------------------------------------------------------------------------

For Android App
Following these steps

Note:-If you are in upgraded version of Android studio then click on "Tools->Firebase->Login->Connect to firebase".




 OR

If  above method does not work for you login firebase in browser and under Console select project
1.Goto project setting 
2.Select android 
3.Copy package name from android project app and paste it to register app
4.Download google-service JSON File 
5.Paste that file under app folder in project folder of your project.







Note:-Now Click on Add Realtime database to your android project to connect your database to your project.


Coming to database and storage

1.Database where information is saved like name email phone etc.

2.Storage where image,pdf,file etc. is stored.

Data will not inserted untill you make following changes

1.Change database cloud beta to real database








2.Under rule section change read and write to true.











Want to know how to host website on firebase for free from your desktop.?
Comment below

No comments:

Post a Comment