I
I
IceNix2020-08-27 19:38:01
Android
IceNix, 2020-08-27 19:38:01

Android Studio What's the best way to implement Multiple Server Requests?

Good afternoon! I'm learning Android development. We have a self-written personal account of the order manager (PHP website), I want to receive notifications on the phone about events taking place there, everything related to PHP is not a problem, we write a script when accessing which a task is issued for the Android application, we know this.
The question is what method in the Android application to implement frequent requests to the server (I already use Volley and json) to check these very "tasks" using the Timer or AlarmManager, or are there any other possibilities (?????), as for example it is implemented in messengers? They do not consume a lot of energy in the background and are constantly "Online". Tell me what is better to use in my case, I think that Timer with an interval of 3-5 seconds is not the best solution. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alekseyHunter, 2020-08-28
@IceNix

1. I will not quote my teacher from the university. In short, you have a bad approach.
2. Use push notifications. Free - Firebase.
3. If you track in the application in dynamics - web sockets.

I
illuzor, 2020-08-27
@iLLuzor

It's called "goodbye battery". You can't do that.
For these purposes, there are push notifications. Messengers work through them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question