A
A
adrenalinruslan2019-11-16 15:05:54
Java
adrenalinruslan, 2019-11-16 15:05:54

How to send a request from phone to phone?

I want to create a simple application of this type:
Each android will have its own ID, and if you enter in the application the ID of which android that has this application installed, you can find out what percentage of the charge is currently on this phone)
Please tell me how this can be implemented?
Only one thought comes into my head, this is to send a request to the database every second in the background to find out if there is an entry with id android-a, if there is, then find out the percentage of charge and add this entry to the database, and on the device that I wanted find out this information, bring this information out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alina Mitrokhina, 2019-11-16
@fursa08

Sending a record every second in the background is not good. Services in Android O are very limited in their work. The use of schedulers is recommended. JobScheduler, WorkManager (I recommend it. It is very easy to start using it. And all its features are described in those four lessons that I threw off from startandroid.ru)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question