I'm using C2DM in a project. I want to show device status (battery remaining, sdcard availability...) when user logs in my website. Here is my implementation:
- Upon their log in, the 3rd-application server (my website) will send a "login" push notification message to the device
- When the device receives the "login" notification, it will send the latest device status to the 3rd-application server
If when the device is offline, the 3rd-application server will not receive any update. I currently define a "timeout" (1 minute) to detect if the device is offline or is not able to send device status.
My questions are:
- Is there a better way to implement this app?
- How to choose a best "timeout" value?