TCP-based RPC server (Erlang or something similar?) for iOS/Android app communication

前端 未结 6 1567
清酒与你
清酒与你 2020-12-23 17:15

I\'m building native mobile applications in both iOS and Android. These apps require \"realtime\" updates from and to the server, same as any other network-based application

6条回答
  •  萌比男神i
    2020-12-23 17:40

    One reason to go with HTTP instead of a custom service is that it's widely supported on a transport level.

    With mobile devices, a user might be on Wi-Fi at a hotel, airport, coffee shop, or corporate LAN. In some cases this means having to connect via proxy. Your application's users will be happiest if the application is able to use the device's proxy settings to connect. This provides the least surprise -- if web browsing works, then the application should work also.

    HTTP is simple enough that it isn't difficult to write a server that will accept HTTP requests from a custom client. If you decide to go this route, the best solution is the one that you don't have to support. If you can write something in Erlang that is supportive of application changes, then it sounds like a reasonable solution. If you're not comfortable doing so then PHP or J2EE gets bonus points for the availability of cheap labor.

    While HTTP does benefit from being widely supported, some successful projects are based on other protocols. The Sipdroid developers found that persistent TCP connections do greatly improve battery life. Their article on the topic doesn't address the server side but it does give a high-level description of their approach on the client.

提交回复
热议问题