Reputation: 5023
We are developing an app that will have Web service in JAVA and Application in iOS. Web-service will compute the list on a Particular Algorithm and that list has to be Shown realtime on the Device.
We were thinking of making a Routine Post Calls on every minute and get result from server but I think this would be very Costly and inappropriate way for syncing data with the Web-service's Result.
Can anyone provide Best alternative and Ideal Way for such type of requirement. Which approach should we choose to Provide such Real-time Sync for application.
Upvotes: 2
Views: 668
Reputation: 10803
Use netty-socketio java realtime framework, it supports long-polling and websocket transports. javascript, ios, android client libs also available.
Upvotes: 1
Reputation: 5023
After googling and research, I found Socket.io better option for Our case Socket.IO is a WebSocket API created by Guillermo Rauch, CTO of LearnBoost and lead scientist of LearnBoost Labs. Socket.IO will use feature detection to decide if the connection will be established with WebSocket, AJAX long polling, Flash, etc., making creating realtime apps that work everywhere a snap. Socket.IO also provides an API for Node.js which looks very much like the client side API.
Upvotes: 0
Reputation: 4371
As you mention it doing a routine post call every minute could work, but it will cost a lot of resources. It's not a good solution. One solution could be to use websocket. So the server will send notification when data have changed. See here what is websocket http://fr.wikipedia.org/wiki/WebSocket
Upvotes: 1