Android Question What is the best way to make a Service between apps?

nicieri

Active Member
Licensed User
Longtime User
Hi, I need to make an App to be able to receive a command from my server in any moment in real time.

What is the best Service type to do this??.. (any moment in real time).. foreground?

I'm tried with TCP Connection.. making ping every minute for guarantee the active connection.

Maybe the Notification... but I don't like to show notification to the user... so X.

Maybe UDP, but this does not guarantee communication.
 

walterf25

Expert
Licensed User
Longtime User
Hi, I need to make an App to be able to receive a command from my server in any moment in real time.

What is the best Service type to do this??.. (any moment in real time).. foreground?

I'm tried with TCP Connection.. making ping every minute for guarantee the active connection.

Maybe the Notification... but I don't like to show notification to the user... so X.

Maybe UDP, but this does not guarantee communication.
you can create a Sticky_Service this will re-start your service even if the OS decides to kill it, it will automatically get re-started, you can schedule the service to re-start every so often, let's say every 30 seconds or so and you can ping your server and check if there's a connection.

Regards,
Walter
 
Upvote 0

nicieri

Active Member
Licensed User
Longtime User
Ok, but you can't do a Tracking solution based on push notifications... maybe to do the location on demand.
 
Upvote 0

Descartex

Well-Known Member
Licensed User
Longtime User
You can do it with a push notification, when it arrives at the device, it send the current position to the server...
 
Upvote 0
Top