1

I am new in android development and I have an android project in android studio that use firebase and I am following the documentation of admin sdk "Add the Firebase Admin SDK to Your Server" to control the roles of users in my android application, but really I don't understand the documentation, my question is where i can write or edit the firebase admin sdk code (that illustrated below) in my android project ?

here is the snippet code from the tutorial

FirebaseOptions options = new FirebaseOptions.Builder()
    .setCredentials(GoogleCredentials.getApplicationDefault())
    .setDatabaseUrl("https://<DATABASE_NAME>.firebaseio.com/")
    .build();
FirebaseApp.initializeApp(options);
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

1

Firebase Admin SDK is supposed to be installed and used on a Server-side and not on Client side (Android app). You can't use it even if you want to.

(Read - Firebase Admin SDK for Android, methods not found)

So you have to install the Admin SDK on a Server and write your logic there and make requests to the server from your Android app to get the results you want.

Hope it helps

Susheel Karam
  • 837
  • 7
  • 16