Theory
A backend without building a backend
Your FestConnect Mobile app (built in Kotlin last semester) works on the phone, but it cannot yet log users in across devices or store data in the cloud. It needs a backend. Building and running your own servers for that is a lot of work.
Firebase offers a shortcut: it is Google's backend-as-a-service, a collection of ready-made cloud services your app simply connects to. Authentication, databases, storage, all provided and hosted by Google. This subject uses Firebase to turn FestConnect Mobile into a real cloud-connected app. This lesson introduces Firebase and how to wire it into an Android project.
Theory
What Firebase provides
Firebase is a backend-as-a-service (BaaS): instead of writing server code, you use Google's hosted services through an SDK. The ones this subject focuses on:
- Authentication: sign users in (email/password, Google, Facebook).
- Cloud Firestore and Realtime Database: store and sync app data.
- Cloud Storage: store files like images.
There are more (Hosting, Cloud Messaging for notifications, Analytics), but auth and databases are the core for a mobile app. The appeal is clear: you get a scalable, managed backend without provisioning servers, so you focus on the app itself.
Follow along
Connecting Firebase to an Android app
- Create a Firebase project Sign in to the Firebase console and create a project for FestConnect.
- Register the Android app Add your app to the project using its package name (the applicationId).
- Add google-services.json Download the generated config file and place it in the app module.
- Add the SDK and plugin Add the Firebase SDK dependencies and the google-services Gradle plugin.
- Sync and use Sync Gradle; the app can now call Firebase services (Auth, Firestore).
Practical
Adding Firebase to the app's Gradle (listing)
// app-level build.gradle: apply the plugin and add SDK dependencies
plugins {
id 'com.android.application'
id 'com.google.gms.google-services' // reads google-services.json
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:33.0.0')
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
}
// google-services.json (from the console) sits in the app module.Formula
The config file is the link
The google-services.json file is what ties your specific app to your Firebase project. Downloaded from the console when you register the app, it contains the project's identifiers and keys, so the SDK knows which backend to talk to.
Without it (and the google-services plugin that reads it), the Firebase SDK cannot connect. So the setup is really: create the project online, register the app, drop in google-services.json, add the SDK. Get those right and every Firebase feature becomes available to your Kotlin code. This same JSON-config idea appeared on the web side in BCA603-01; here it is the Android equivalent.
Quiz
What best describes Firebase in the context of an Android app?
- A programming language for Android
- A backend-as-a-service: hosted cloud services (auth, databases, storage) your app connects to instead of building its own backend
- A replacement for Kotlin
- A design tool for layouts
Show the answer
A backend-as-a-service: hosted cloud services (auth, databases, storage) your app connects to instead of building its own backend
Firebase is a backend-as-a-service (BaaS): Google-hosted cloud services, authentication, Firestore and Realtime Database, storage, and more, that your app connects to via an SDK, sparing you from building and running your own backend. Option A is wrong: Firebase is a platform of services, not a programming language (you still write the app in Kotlin/Java). Option C is wrong: Firebase does not replace Kotlin; your Kotlin app CALLS Firebase. Option D is wrong: layout design is done in Android Studio's tools, not Firebase. Firebase provides the backend so you can focus on the app.
Think first
Why use a backend-as-a-service instead of building your own server?
You could write an Express backend (as in BCA603-01). Why might a mobile app reach for Firebase instead? Then tap.
Show the answer
Because a backend-as-a-service like Firebase lets you SHIP FASTER and avoid the heavy work of building, hosting, scaling, and securing servers yourself, which is especially valuable for a small team or a solo developer. Building your own backend means writing authentication (securely hashing passwords, managing sessions/tokens), setting up and maintaining a database, provisioning servers, handling scaling as users grow, applying security patches, arranging backups, and keeping it all running, a large, ongoing responsibility. Firebase provides all of that as managed, battle-tested services: authentication with multiple providers works out of the box, the databases sync in real time and scale automatically, and Google handles the servers, security, and uptime. So you connect your app to Firebase and immediately have login and cloud storage, with far less code and no servers to run, letting you focus on the actual app experience. The trade-offs are real: you depend on Google's platform and pricing, you have less control than a custom backend, and very specialised needs may not fit Firebase's model, which is exactly why BCA603-01 also teaches building your own Express/Node backend. The professional lesson is that both approaches are valid tools: a BaaS like Firebase is ideal when speed, real-time sync, and low operational burden matter (common for mobile apps and startups), while a custom backend suits when you need full control or specific logic. Knowing both lets you choose well. Managed services trade some control for enormous convenience.
Summary
Key takeaways
- Firebase is Google's backend-as-a-service (BaaS): hosted cloud services your app connects to instead of building a backend.
- Core services for mobile: Authentication, Cloud Firestore and Realtime Database, and Cloud Storage.
- Setup: create a Firebase project in the console, register the Android app by package name, add google-services.json, add the SDK and plugin.
- The google-services.json config file links your specific app to your Firebase project so the SDK knows which backend to use.
- This turns the Kotlin FestConnect Mobile app into a real cloud-connected app.
- A BaaS speeds development by managing servers, scaling, and security, at the cost of some control (custom backends, as in BCA603-01, remain valid).
- Memory hook: Firebase is a ready-made cloud backend; google-services.json is the link that connects your app to it.