- What is the best way for a server to notify an app that some new data is available?
- How to detect when an Android app goes to the background and come back to the foreground?
- What is alerting notification?
What is the best way for a server to notify an app that some new data is available?
Use web socket. My application's one time usage expectation is ~2 minutes. So web socket looks like a good choice, because app will be terminated or go to background state quickly and battery consume won't be much. Also all the server side data changes will come to the device just in time.
How to detect when an Android app goes to the background and come back to the foreground?
The onPause() and onResume() methods are called when the application is brought to the background and into the foreground again. However, they are also called when the application is started for the first time and before it is killed. You can read more in Activity.
What is alerting notification?
Alerting: You'll hear a sound, get a message on your lock screen, and find the app's icon in the status bar. Silent: Your phone won't make a sound or vibrate. But the notification will show up when you swipe down from the top of your screen.