Hey guys, This is from Allwebr.com, Today we will talk about Working with Firebase
We’re going to talk about Firebase, our application development platform. In this post, we’re going to cover introduction to Firebase, what common development problem it solves, and what product it includes. After that, we’re going to look into what set of services application developers can use to build better applications, improve their application quality, and engage their users. We’ll go over a customer success story, then we will run through the Firebase console and how to connect an Android app to Firebase.
And finally, we will wrap up with some resources you can follow up with. So what is Firebase? Firebase is our mobile development platform that allows you to quickly build and grow your app. Using Firebase, we provide a set of tools and Cloud Services that help mobile and web developers solve common challenges across the app lifecycle–from building an app, to improving its quality, to increasing user engagement. Firebase is easy to integrate on iOS, Android, and the web, as well as C++ and Unity to support for game developers. We have a purpose-built SDK for each popular platform to help you move quickly and help ensure that your app is the same quality on every platform. After this short introduction to Firebase, let’s take a look at a typical application lifecycle, which has three main phases.
The first phase is the development phase, when you’re developing a brand new app or adding a new functionality to an existing app. Once your application is ready, you want to share it with your users, but in a controlled fashion, while keeping an eye on any potential crashes that may happen. Finally, once your users start enjoying the new app, you want to learn more about them–identify the most valuable users and decide to further personalize their experience to retain them. Firebase, with its comprehensive set of tools and Cloud Services, helps solve these three core problems in your application lifecycle.
There are 19 services that are divided into three categories–build better application, improve application quality, drive user engagement. Starting from the left, if you’re rebuilding a new application, Firebase offers a completely server less approach to getting started. Once the application is built, we offer tools to help you to improve stability and performance of your application. Then finally, we have a set of tools to help you drive user engagement and retention. Let’s start with the development phase category of products. Let’s take a look at your normal app architecture, something that most of you probably recognize from your own projects. You’ve got your mobile app, which communicates with your main frontend server using a RESTAPI.
That server talks to your all other backend services. You’ve probably got a server for authentication and a server for media files. You also have a database, which is one of the first decisions that app developers make. You may be concerned about your infrastructure and how it will grow with your company. What about if you want to include new platforms? How would you scale your frontend server? Is your authentication server secure? Is your media server terabytes ready, and database fast enough? Instead of the diagram before, here is what it looks like with Firebase. Let’s build together a mobile app that process user-generated content. It could be a photo album, accessible from both mobile and web interfaces, that attacks and extracts from any image uploaded by the user and presents the result back to the user. The first step in designing our app architecture is user authentication.
Firebase authentication is an out-of-box authentication UI that supports email and password phone authentication, and Facebook and many others. Now that the user is authenticated, they can upload their image to Cloud storage, a secure place in the Cloud for user content. The event of a new image uploaded to Cloud Storage will trigger Cloud Functions that, in our case, will perform optical character recognition on the image. Firebase ML Kit makes it easy to access machine learning models from your app. Now that we have extracted the text from the image, we will store it in Cloud Fire store, a real time No SQL data base.A Cloud app can subscribe to notifications of new data being stored in Cloud Firestore. And so our users quickly receive a notification of what text has been extracted from their image. The user confirms that the text is indeed correct. If we were building a Cloud-native app from scratch, we may finish our work here. But what if we’re adding a Cloud-native module to an existing legacy app that’s running most of its legacy logic on-prem? In that case, you can simply expose the Secure API to your legacy backend and utilize Cloud Functions to notify the backend every time user approved a new entry to Cloud Firestore.
Now that we covered the benefits of developing apps with Firebase, let’s talk about keeping them healthy. Firebase can help here too. So you have built your app. It’s got a huge list of great features. It’s doing well in your alpha test. You’re sure it’s better than anything out there. But what if your application is buggy or unstable in the real world? You may receive bad reviews. If your application crashes, user may become unhappy and might leave negative reviews that’s care away potential new users. What can you do? Let’s see how Firebase can help you too. You have just finished developing a new feature for your application and you’re ready to publish the updated application to Apple and Play Stores. When rolling out a new feature, you may want to push it to a small percentage of users first.
With Firebase, you are in full control of your rollout. First, before you upload a new build to the app stores, you can put a new feature behind the feature flag using Remote Config. Then, using Google Analytics for Firebase, you can select the one percentage of users who will experience the new feature first. Once the one percentage of users have the new feature enabled, you can use Firebase Performance Monitoring and crash analytics to monitor user experience who have new feature enabled and look for any potential app crashes that new feature may cause. We can dive more deeply into our data by exporting it to BigQuery. Soon, we’ll have identified that the app only crashes for the users with very old devices, but works fine on almost 100% of the devices.
At this point, you may want to exclude the problematic devices from your rollout while allowing the vast majority of your users to enjoy the new feature. Finally, we have arrived at the perhaps most critical stage of the application lifecycle. Once the application built with Firebase is out in the world and you know it performs as expected with all Firebase monitoring dashboards indicating health, you can focus on acquiring and retaining your most valuable users. First and foremost, you need to know your users. With Google Analytics, you can easily divide your users in to audience segments so you can further personalize their experience. Next, with Predictions, you can utilize machine learning to predict future user behavior based on the historical events captured in Analytics. Finally, if you really need to dive deeply into your data, you can mirror all the events to Big Query.
After you understand and start segmenting your user base, it’s time to start experimenting optimizing your application performance. Core to this is Remote Config, that allows you to remotely change your application behavior without the need to ship a new build, which would be time consuming and inconvenient for the user. Combined with Google Analytics and A/B testing, you can design and execute experiments to test what makes the most optimal app experience for a targeted segment. Finally, you need tools to help retain your existing users and acquire new ones. In-app messaging offers push notifications that pop up in the app to present your most valuable users with a special offer, for example. Cloud Messaging will help you reach your users who haven’t visited your app in a few days to reengage them.
Finally, if you’re planning a marketing campaign and you want to advertise your app on, say, third-party websites, Dynamic Links will be a great tool. Dynamic Links will help your prospects look at your app in the respective app stores. If the user clicks on the link from an Android device, they will automatically land in the Play Store, while an iOS user will be pointed to the Apple store. Many customers use Firebase to build and operate their applications. One of them is Surfboard Payments, a Swedish-based in tech developing next-generation payment solutions.
By downloading their application, any merchant can start accepting electronic payments in minutes. Surfboard Payments used Firebase in order to be able to prototype quickly, spot errors by testing before releasing, and sync in-store user-generated content in real time. Now, let’s go over a short demonstration of how to connect an Android app to Firebase. Step one, create a Firebase project. In the Firebase console, click add project. To create a new project, enter the desired project name. If prompted, review and accept the Firebase terms. Click Continue. Optional step is to set up Google Analytics for your project or use an existing account. And I’m going to use my Analytics account, which I already created for this demo. Click Create Project.
Firebase automatically provisions resources for your Firebase project. When the process is complete, you’ll be taken to the Overview page for your Firebase project in the Firebase console. Step two, register your application with Firebase. Go to the Firebase console. In the center of the Project Overview page, click the Android icon or Add App to launch the setup workflow. Enter your app’s package name in the Android package name field. Click Register App. Step three, add Firebase configuration file. To add the Firebase Android configuration file, first click Download google-services json file to obtain your Firebase Android configuration file. In the second step, move your configuration file in to the module app-level directory of your app. In the project-level Gradle file add rules to include Google services Gradle plugin. Make sure that you have Google’s Maven repository as well. In the app-level Gradle file, apply the Google services Gradle plugin.
Step four, add Firebase SDK. Using the Firebase Android BoM, declare the dependencies for your Firebase products that you want to use in your app. Declare them in your app-level Gradle file. Sync your app in order to ensure that all dependencies have the necessary versions. And that’s it. You managed to successfully add your app to Firebase. And this brings us to the end of this post, where we learned that Firebase has an array of offerings that help developers to work better and faster. To continue to explore what Firebase has to offer in further details, check out our suggestions here–and don’t forget on the links in the description. We will see you next time, when we will go over different services and tools for CI/CD on Google Cloud. Don’t forget to like and subscribe to our YouTube channel. Click on the bell icon to get notified each time a new post is posted.
If you are new then subscribe to our newsletter for useful posts. Stay safe and follow our website for more latest informative posts.
Take care and Bye Bye. Best regards allwebr.com