Natural webservice type for Android [closed]
We want to track GPS
data on Android and send it to server, ther开发者_如何学编程e will be also another two-way communication.
Question: What is the most natural/easy-to-implement type of webservice on the server side to which can Android connect? We would like to use classic .NET WCF Web services, is it a good choice or something like XML-RPC would be better?
The easiest to implement would be REST Based API that returns JSON data (whichever platform you choose).
Part of the reasons :
- Built in HttpClient in Android for REST Operation such as GET AND POST.
- Easier to construct the input through URL for GET or even POST compared to SOAP or XML message construction
- JSON library is built in as part of Android, making it easy to work with JSON result. Walking JSON key-value pair is easier than walking through XML Structure
- As a mobile app, it needs a compact data to be transferred through a network and JSON is lighter than XML RPC
- As an additional plus outside Android, the REST API with JSON is also easier to integrate with the web counterpart, so you will have API for multi channels delivery
精彩评论