Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access data of another firebase project

I created real time database on firebase, from one android app im sending data and in other app(second separate app different from the app im using for send data, for just retriving if there is change in data) i want to receive that data, how can i do this, because if I'm trying to access like this in onCreate

FirebaseApp.initializeApp(this);

DatabaseReference data = FirebaseDatabase.getInstance()
            .getReference("https://my-project.firebaseio.com/nodeName");

I'm getting first initialzeApp also i tried with adding google-service.json from my app that sending data, its saying that its different from project name, how can i do that the firebase structure is like this

{ https://my-project.xxxx somenumbers
    {
        node{
               lat : "value"
               lng : "value"
            }
    }
}
like image 565
blackHawk Avatar asked Oct 17 '22 09:10

blackHawk


1 Answers

For every Android app that you create in Android Studio that you want to use with a specific Firebase project, you should create an Android app in the Firebase console too. You can do this by going to the overview page of your project and clicking "Add another app".

like image 134
Frank van Puffelen Avatar answered Oct 21 '22 04:10

Frank van Puffelen