Android app to app communication

429 views Asked by At

I want to create an android SOS app which will send location and a message of a person (who presses the button) to everyone else who is using the app.

Please guide me the simple way to make this app with proper requirement.

1

There are 1 answers

0
Simon Schnell On

What the app needs

  • a button which (when pressed) sends the current GPS to a server
  • a listener who listens to your server

What I would do (using REST and Firebase Cloud Messaging)

  1. create the app with the UI and
  2. Implement some REST that can send your gps position via JSON to your FCM Endpoint
  3. Implement FCM the get Push Notifications

What you JSON could look like

{
   "user": "ID",
   "long": "49.141699",
   "lat" : "9.219405
}

This could be delivered to everyone actively using the app.
If the message is delivered, then you can intent from the notification to another activity which shows the sos marker on a map and maybe navigate there. With only doing this you would need only a Google Account and no other server.

These are the very basics how you asked. But...

Problems

With just this everyone sending a sos will directly send to everyone a sos call. There is no server between the sos caller and the delivery of the sos. So there will happe some problems. Everyone around the world (who uses the app) will get this message.
So you need at lest a function that matches the distance between the sos caller and the "helper". Maybe implement some regions like just my town or whatever.