开发者

What is a good approach to handle sync between phone and website? [closed]

开发者 https://www.devze.com 2023-03-24 01:47 出处:网络
It's difficult to tell what is being asked h开发者_如何学Goere. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being asked h开发者_如何学Goere. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

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?

  1. Automatic updates - The app sends a request to the web server to look for changes each XX seconds and updates if necessary.

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消