If you are a seasoned full stack developer then this is not an article for you. This article is primarily aimed at developers who have lots of experience building apps but not necessarily app backends.
Choosing a backend
A backend is a server that exposes certain API to the the app. The app then makes network requests to this backend using the api. Chances are you already know how this works.
Firebase
But how exactly are backends built ? There are two primary options before you. Use some service like Firebase which allows you not to even own a server and just gives you Android SDKs to build your app. Such services can fully support nearly all major use cases that an app might require.
The problem with such solutions however lies in the fact that these services are often paid and more expensive. Also, the frequently changing apis mean you have to keep updating your app from time to time.
Also, at some point you might have to also have a website or other sort of interface that uses the same backend or have custom integrations with other services at which point services like Firebase prove to be inadequate.
Other option before you is to build something of your own. This requires considerable learning curve.
Build your own backend
Spring Boot
Over years this has been my favourite framework to quickly roll out services that are accessed by the the app. This is a Java or Kotlin based framework but runs with very little memory footprint. It is extremely powerful and has no limits of what it can do, but for the app usecase where you just want a REST API it can be extremely simple to setup and deploy on say Google Cloud Run.
Laravel
This is one of the most popular PHP frameworks and knowns as "batteries included" framework which means it has nearly everything in built to build a proper backend API. PHP is also lot simpler to understand and learn and there is a large community that can support you.
The disadvantage is that it is less performant than Spring Boot and might require more complex setup to run in containerized environment.
Rails
Ruby on Rails is another rapid application development framework that can satisfy most of your needs however it invariably requires more server resources than anything else. It has code generation tools that generate most of the Ruby code for you which is simpler to understand.
NextJs
While Nextjs is typically considered front end framework it does support full stack development and it can certainly expose a REST api for your Android app. More importantly it is incredibly simple to turn this web api into a full fledged web application if you want that.
Learning to build backends
Well, it is out of scope for this particular article though our other engineering blogs might cover this in greater depth eventually. However you should be prepared to learn new languages, new terminology and be comfortable with things like SQL, Cloud deployments and Docker. If you dont have time for that then just look at something like Firebase.
References:
[1] https://www.frontendeng.dev/blog/30-spring-boot-for-full-stack-rails-laravel-alternative ↗
[2] https://spring.io/projects/spring-boot/ ↗