That's a very difficult question. I do not recommend using a “turnkey” solution such as FireBase, because it is even harder to convert it to the “correct” API later when you need it. If you know Android, then you know Java, you will have no problems learning how to work with a framework like the Spring Framework, which I recommend. Java on the backend needs a Java Servlet container such as Tomcat. To do this, you must first configure the development environment on your machine. I recommend looking for Spring Framework tutorials for this Spring Framework REST tutorial.
Secondly, for data storage you will need a database, such as MySql or MongoDB. Spring comes with ready-made connections to most of the most common databases, so it's pretty easy to work with.
When you are ready to deploy your service, I recommend using PAAS, for example, Heroku.com, where you can first start your service for free. Thus, you yourself control everything, and you also learn a useful skill.
source share