4
4
4ainik2017-01-30 11:38:58
Android
4ainik, 2017-01-30 11:38:58

How is the mechanism implemented in android?

For example, this is implemented in the VK application, even if no one has launched it, but if someone writes you a private message, then a new message notification appears in the panel.
How is this mechanism implemented in android and what is it called?
Those. you need keywords that you can google something for.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2017-01-30
@4ainik

Google "services".

I
itdroid, 2017-01-30
@itdroid

Look towards push notifications.
https://firebase.google.com/docs/cloud-messaging/
I will add to the answer:
Push notifications are needed so that the server itself tells your application that new data has appeared.
If the server does not know how, then you need to interrogate it yourself, AlarmManager will help you with this (link to the docks in the comments). The AlarmManager can start a Service or send a broadcast at a specific time (you choose when).
To make everything work after a reboot, look towards BroadcastReceiver and ACTION_BOOT_COMPLETED ( https://developer.android.com/reference/android/co...
To notify the user that there is new data, you can use Notifications : ( https://developer.android.com/guide/topics/ui/noti...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question