I am invited to create an Android application that receives input from the “central station” and receives a warning, for example, “respond immediately”.
I am new to Android programming, so I have no idea how to get such a live input, so any help would be appreciated.
This question has two parts. I think the first part is up to me. But still, it’s important to find the right path.
1) how will the "central" alert the user? At the moment, I have two solutions:
1.a.) The central part can insert the database record on the server, and the application constantly (1 per minute) sends requests to the php file and asks if there is a record with id = my_id and status = "not read".
1.b.) Central sends SMS to the device, and my application listens for incoming SMS messages from this number.
and the important part:
2) How can I make sure that the device receives a “warning” even if the user has closed the application?
Thanks for any help!
source
share