Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can multiple android application access same firebase database?

Is it possible for multiple android applications to access a single firebase backend. If no what is the alternative in such situation?

like image 932
Rage Avatar asked Jun 17 '16 06:06

Rage


People also ask

Can two apps access same Firebase database?

Yes, it is! a single firebase database can be access by multiple app.. provided each of your apps use the same authentication details.

Can a Firebase project have multiple apps?

However, when you want to access multiple projects from a single application, you'll need a distinct Firebase application object to reference each one individually. It's up to you to initialize these other instances.

Is it possible to have multiple iOS android and web apps under a single Firebase system?

A Firebase project can have one or more Firebase Apps registered to it (for example, both the iOS and Android versions of an app, or both the free and paid versions of an app).


4 Answers

Yes, it is possible. Go to your firebase console. Select home tab. Click on Add App. Select Add firebase to your Android App. Provide the necessary details for the package name. Download the latest config file and add it to all the android apps connected to this firebase project.

like image 59
Pavan Patil Avatar answered Oct 09 '22 19:10

Pavan Patil


With Android Studio 2.2 and upwards you can easily create and add apps to you Firebase project without leaving your work environment and no need to download google-services.json

From Android Studio go to Tools->Firebase and create, add apps to project of choice :)

Guide

enter image description here

like image 27
Enoobong Avatar answered Oct 09 '22 20:10

Enoobong


Yes, it is possible for multiple applications to access the same Firebase Database. From Android Studio v2.2 onwards, you can directly link an app to a Firebase database via the Firebase Assistant. Here is how to do so:

  • Go to Tools and click on the Firebase option. pic_1


  • From the Firebase Assistant, select Realtime Database pic_2


  • Click on the Connect to Firebase button in the Assistant, which will show you a dialog allowing you to select an existing Database or create a new database. Click on Choose an existing Firebase project, select the Database you want to use and click on the Connect to Firebase button in the dialog. pic_3


  • Your app will automatically get connected and you will be able to access your database. pic_4
like image 5
Irfan S Avatar answered Oct 09 '22 18:10

Irfan S


Yes, you only need to setup your Firebase object with the same url(db). Check the documentation for more. https://www.firebase.com/docs/android/guide/retrieving-data.html

like image 4
Erik Minarini Avatar answered Oct 09 '22 20:10

Erik Minarini