I have a background app that has to upload small amount 开发者_JAVA百科of data (several kb) to the cloud every day. In your opinion what is the best way to trigger the upload?
Should I trigger it at specific time of the day or at some other event? What if the upload fails (airplane mode) - how long should I wait before I try again?
My app gets awaken every time the phone detects a region change (cell tower change), so I could use that as event. My main concern is battery usage.
Thanks, Ventsi
Do it every 24 hours. In case it fails (no coverage?), try again on cell tower change. If this has succeeded once, revert back to 24 hour timer.
精彩评论