I have a website where users can create lists and add items to these lists. I'm also developing a mobile app that communicates with the website. If the user has a web account in the phone and he/she creates a new list/item it should also be sent to the web. The phones lists/items should always stay the same as the web. Also, of course, if someone add/remove/edit lists or items those changes should be updated on the phone.
So, everything works good when using the phone, I just send the same info to the web as I save in my app. Easy.
But what is the best way to update the phones lists and items when there are changes on the web?
Automatic updates - The app sends a request to the web server to look for changes each XX seconds and updates if necessary.
User updates - The user has to hit a "refresh" button of some kind to refresh.
Is #1 a battery drainer? Which is the preferred choice to take?
I'm developing with Titanium for both iOS and Android.
I'd provided both of them. You can have some encoding algorithm which will send signal to web services to decide if it is to update.
What about google C2DM or iOS push notifications? You'd have to keep track of user device IDs though. But when something changes on the website, the most efficient way of telling the device is to send a message to it. If you poll, you'll be wasting battery.
精彩评论