How to deploay project to firebase from my pc..? How to host project to firebase using command line from my pc.?


Hello friends, 

It sounds like very tough that how to host project from pc using command like. But in real it's just two step process.

Note:- Command line for windows and are cmd and terminal respectively.

 Before moving ahead you must have installed NodeJS in your pc Download NodeJS. 

If you have done that then use command node -v  in cmd it will you version like v1.0.90.
If you got this that great you are ready to go ahead. 

  •  Step1
    • Login to firebase console
    • Create a project  
  • Step 2
    • Open your project folder in your pc
    • Type cmd in top bar (www->kapilonline->cmd) and enter
    •  You will see a black screen command line interface is prompt
  •  Step 3
    • Use command firebase login
    • Use command firebase deploy




 Bingo!!!! You deployed your project to firebase. 
If  still problem there something missing and not working out for you comment below

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

Tcs question to print series 1,2,1,3,2,5,3,8...

#include <stdio.h>

int main()
{
     int n,j=2,i,a=1,b=2,c;
     int arr[20];
     scanf("%d",&n);
     arr[0]=a;
     arr[1]=b;
         
         for(i=1;i<=n;i++){
             
             c=b-a;
             arr[j]=c;
             j++;
             a=b;
             b=c;
             
             
             c=b+a;
              arr[j]=c;
             j++;
             a=b;
             b=c;
            
             
         }
     //display series
     
     for(i=0;i<10;i++){
         printf("%d,",arr[i]);
     }
      
}

Tcs question - C program to reverse string using command line

#include <stdio.h>


int main(int argc,char *argv[])

{

    int len;
     char *ptr;//take pointer to traverse
     
    ptr=argv[1];
    
    
    len=strlen(argv[1]);

    if(argc==1){

        printf("Error:Please enter atleast one argument");

        return 0;

    }

        while(len>=0){
            
            printf("%c ",ptr[len--]);
        }



      return 0;

      

     

     

}

Tcs question C program to find LCM in command line

#include <stdio.h>


 int main(int argc, char *argv[])
 {

 int lcm,i,num1,num2,max_value=0;
  num1=atoi(argv[1]);
  num2=atoi(argv[2]);
   
   max_value=(num1>num2)?num1:num2;
   
  while(1){//Always true till we get the lcm
      
       if(max_value%num1==0&&max_value%num2==0){
           
       printf("LCM is :%d",max_value);
       break;
       }
       ++max_value;
  }
  
  

return 0;
}

Tcs question find out gcd of two number in c using command line

#include <stdio.h>


 int main(int argc, char *argv[])
 {

 int gcd,i,num1,num2=0;
  num1=atoi(argv[1]);
  num2=atoi(argv[2]);
   
  
  for(i=1;i<=num1 && i<=num2;i++){
      
      if(num1%i==0 && num2%i==0){
      gcd=i;
          
      }
  }
  printf("GCD is :%d",gcd);

return 0;
}


Tcs question print string in c using command line

#include <stdio.h>

int main(int argc,char *argv[])
{
     
    if(argc==1){
        printf("Error:Please enter atleast one argument");
        return 0;
    }
    
//Note:- argv[0] is by default 0 our input string start storing from argv[1]. So it's better to start for loop from 1

      int i,v=0,size=argc-1;
      
      char *str;//intialize pointer
      
      //allocate memory to which pointer points
      
      str=(char*)malloc(v);//intially zero
      
      //now re allocate memory as per size of input sting arguments
      for(i=1;i<=size;i++){
          
     int length=v+strlen(argv[i]);
      str=(char*)realloc(str,length);
      
      //now concatenate the string argument
      strcat(str,argv[i]);
      //give a namespace
      strcat(str," ");
      }
      
      //now print string use %s not %concatenate
      printf("%s\n",str);
      
      return 0;
      
     
     
}