Learn more about Firebase Android

Tram Ho

When you develop Android apps using Firebase, you’ll see Firebase-specific concepts. This article will help you understand more about Firebase, or there are resources for you to read for more reference.

1. Firebase Assistant plugin for Android Studio

Firebase Assistant is an Android Studio plugin that registers your Android app to a Firebase project and adds the necessary Firebase config files, plugins and dependencies to your Android project – all with Android Studio!

Follow the instructions from here to use Firebase Assistant. Use the latest version for both Android Studio and Firebase Assistant (go from File> Check for update ).

When you choose a Firebase service to add to your app, Firebase Assistant will automatically define the required dependencies in the app / build.gradle file. However, to use Firebase features, you still have to install it manually, as Firebase Assistant cannot fully handle it yet. You can implement these dependencies manually:

  • If you want to use Firebase Android BoM (see below), update the dependencies in the module (app-level) Gradle file ( app / build.gradle ) to import BoM. You also need to delete versions from each line that implement the Firebase library.
  • If you want to use a Kotlin extensions library (see below), define this dependence in the Gradle file app-level module ( app / build.gradle ) to use Firebase’s ktx library.

2. Google services – plugin and config file

As a step in adding Firebase to your Android project, you need to add google services – plugin and a config file called google-service.json to your project.

  • If you add Firebase to your Android project via Firebase Console or the Management REST API or Firebase CLI , you must manually add the plugins and config files. However, if you use Firebase Assistant, these jobs will be completed automatically step by step.
  • Note a little bit is the config file google-services.json it contains unique identity encryption for your project, it is not a file that needs to be secure. To know more about this config file, visit the Understand Firebase projects !
  • Go to the Android documentation to learn more about how the Google services plugin and config file work together!

3. Firebase Android BoM

Firebase Android BoM (Bill of Materials) allows you to manage all library versions of Firebase by specifying one version – version of BoM.

  • When you use Firebase BoM in the app, BoM will automatically pull all versions of the individual mapp libraries to the BoM version. All versions of the individual libraries will be compatible. When you update the BoM version in the app, all the Firebase libraries you use in the app will be updated to make it compatible with the BoM version.
  • To see how versions of the Firebase libraries match BoM versions, see the BoM release note . If you need to compare the versions of the mapped libraries with the BoM version compared to another BoM version then use the comparision widget below. More about Gradle’s support for BoM platforms .
  • Here’s how to use Firebase Android BoM to define dependencies in the Gradle file (app / build.gradle) module (app-level ). When using BoM, there is no need to add versions of individual libraries anymore:

Here are some frequently asked questions when using Firebase Android BoM, Refer to Question about BoM .

4. Kotlin extensions (KTX) libraries

  • The Firebase Kotlin extensions (KTX) library are companions for the Firebase SDKs base that allow you to write nice and easy to understand Kotlin code.
  • To use the KTX library in the app, change the dependence and add the -ktx suffix. Each KTX library automatically has a base library, so there is no need to include both the base library and the -ktx library, for example:

  • Each dormitory library provides different utilities corresponding to that base library. For example, with the Analytics KTX library, it makes event logging simpler:

Before using the dormitory:

After using the dormitory:

For more on the KTX library, see API reference docs

5. Open source resources for Firebase Android SDKs

Firebase supports open source development, and we can join the community to contribute development and provide feedback on Firebase.

  • Firebase Android SDKs : Most Firebase Android SDKs are developed as open and public libraries on the Firebase GitHub repository . Firebase is moving to move Firebase libraries that are privately developed to this public repo. Stay tuned for new things from Firebase!
  • Quickstart samples : Firebase has a collection of quickstart samples for Firebase APIs on the Android platform. To view these quickstarts, visit the Firebase GitHub quickstart repository
  • You can open each quickstart as an Android project, then run it on mobile devices or virtual machines (ADV). Or you can use the code of these examples in your project to better understand Firebase SDKs.

Here are a few interesting topics, if you have free, you can read and read:

Refer :

Learn more about Android and Firebase: https://firebase.google.com/docs/android/learn-more

Hello and see you in the next post nhaaaaaa !!!!!!!!

Share the news now

Source : Viblo