Introduction
Firebase is a Mobile and Web Development cloud database. It can provide additional features for a developer to develop high-performance applications. Firebase Remote config allows you to change the appearance and behavior of your application without disturbing an update of your application.
The Firebase RemoteConfig parameter values are:
- ·getBoolean()
- ·getByteArray()
- ·getDouble()
- ·getLong()
- ·getString()
In this article, you will learn about how to configure the Firebase Remote Config in Android application by using Android Studio.
Perquisites for Android Application Development
- Android Studio (Latest version)
- Google Chrome (for opening firebase console)
- Android device (for test our developed application)
We can do a step-by-step implementation:
Step 1
In my previous article, I explained how to develop an android app project in Android studio.
Click to read my previous article “How to Create an Android App Project in Android Studio”.
Step 2
After Android project syncing is completed, open the Android Manifest File in app-> manifests->AndroidManifest.xml and add permission for Android application to access the internet for when remote config needs internet connection access for fetching parameter values from firebase.
- <uses-permission android:name="android.permission.INTERNET"/>

Step 3
Next, add a Firebase connection to your Android Application. Click the Tool option in Menubar and then select the Firebase option. The Firebase assistance will be opened on the right side of the Android studio.

Step 4
Click the Remote config in Firebase assistance pane, click “setup Firebase Remote Config”. The new window will be opened inside of assistance.

Step 5
Next, the New Firebase connection window has opened. Then, select Create a new Firebase project radio button. After selecting the project location as “India”, click the “Connect to Firebase Button”. Android studio can start a connection with the Firebase database.


Step 6
After you click the “Add Remote Config to your App” Button in Firebase assistance, Android studio will prompt a window to Accept Changes in Gradle. Click on the Accept Changes Button.

Step 7
Automatically Remote Config dependencies are added in Gradle Files, after completing the Gradle syncing you may open an “activitymain.Xml” file for adding 2 buttons to the layout file. The first button displays the actions of parameter & the second button is for fetching parameter values from Firebase.
Copy and paste tge below XML code in an activitymail.XML file.
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".MainActivity">
- <Button
- android:id="@+id/butnactivate"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textStyle="bold"
- android:text="My Account"/>
- <Button
- android:id="@+id/butnfetcher"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="8dp"
- android:layout_marginBottom="8dp"
- android:text="Fetch"
- android:textStyle="bold"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
- </android.support.constraint.ConstraintLayout>
Step 8
Next, we are write Hava code for fetching parameters from Firebase.Open the “MainActivity.java” file and copy and paste the below Java code in the MainActivity.Java file








Join the conversation! Your thoughts help the community grow.