I am developing an android chat application for learning purposes that uses a server- client architecture. I wrote the server side myself in Java (because I am trying to learn) and the client side is an android app. I am using TCP sockets for communication.
Everything works great when the two clients have their apps open and are connected, but I would like client A to still be able to send a message to client B when client B does not have the app open.
After doing some research I realized that I need to use the android push up notifications that will allow my server to communicate with the client (the android app) even when the app is not opened or running by triggering an intent on the client side. I did some more research and every tutorial that I found is using a third party service as a middle man to achieve this , such as Firebase Cloud Messaging, which defeats my purpose of trying to learn by doing things myself.
Because I am doing this for learning purposes I do not want to use any of these services such as Firebase Cloud Messaging, I would like to trigger the intent myself from the server that I wrote in java without using the middle-man.
The main goal here is to send messages from my server to the android app when the app is closed, without using any third party software such as Firebase Cloud Messaging.
I am unsure of how to achieve this and I would appreciate it if anyone could point me at the right direction. Thanks!