开发者

Best method to make a Distributed Service (Mobile Client - Server)?

i'm working in a little project. The idea is send information from mobile device to a server, then the sever performs some calculations and return a response to de device.

I know how to do this us开发者_Python百科ing Sockets (directly), ut I was wondering if there were any other method (better) for this communication. Something to improve performance and not develop directly with socket add SSL for safety communication process.

Greetings and thanks for reading


I think a web service would be appropriate here. If you want a more detailed answer perhaps you can provide more information about exactly how much data would be transferred, how often the requests would be, etc.


I like to make PHP Pages for the server side, and simply call the PHP pages with the required data in the url. If you allow your mobile app to read the source of webpages, you can read the source of, for example:

http://www.yoursite.com/doSomething.php?id=5

doSomething.php might look something like this

<?php 

    //Multipy the passed value of 'id' by 3
    echo (int)$_REQUEST['id'] * 3; 

?>

So your webbrowser would see the source of that page as

15

Essentially what this demonstrated is passing info to a web service, processing the data, and returning data. The returned data can be anything from HTML, to Text, to XML meant to be used for parsing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜