Differences between JSONXML and phpAndroid. PhpAndroid usage overview JSONXML differences one app communication interface three elements: 1. interface address :( app. comapi. php? Formatxml) 2. interface file: (api. php handles some business logic php Android usage introduction json xml differences
Three elements of an app communication interface:
1. interface address (http://app.com/api.php? Format = xml)
2. interface file: (api. php processes some business logic)
3. Interface communication data
How the App communicates
1. The App sends an http request to the server
2. the server returns data to the App after processing
Different from B/s access:
The address for accessing the server page in B/s mode can be seen in the address bar, but the address cannot be seen during app access, which has been encapsulated.
In B/s mode, the returned data is usually html, and the data format and JSON and XML
JSON and XML
XML: Extensible Markup Language, which can be used to mark data and define data types.
SOURCE language that allows you to define your own markup language.
Features: XML can be customized by nodes and cross-platform.
Root node
Name
JSON (JavaScript Object Notation) is a lightweight data exchange format with good readability and convenience.
Fast writing feature. Data exchange can be performed between different platforms. JSON is highly compatible and completely independent from the language text lattice.
. These features make JSON an ideal data exchange language.
First, parse the string: "s" (It is not easy to understand with this format)
Second, parse the array {"title": "david", "from": "qingdao", "decrip": "hello"} (key: value
For understanding, so this is often used)
Differences between xml and json:
1. readability: the xml structure is clear, and the json output is similar to a string, so the xml is readable.
2. php Data Generation: How does php generate json data: json_encode ($ arr );
How to generate xml data: encapsulate multiple strings and output them together.
Json only uses one function, which is very convenient;
3. transmission speed:
Json has no tags, and the data size is small, so the transmission speed is fast.
App interface function:
1. get data: obtain data from the database or cache, and then return the data to the client through the interface. For example, add data on the main interface
.
2. submit data: (get post), submit data to the server through the interface, and then the server enters the database for processing, or other operations. Class
Similar to submitting forms on the web. For more information, see feedback.
Version Upgrade interface: submit the data of the current version to determine whether to update the data.
Http://www.bkjia.com/PHPjc/927609.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/927609.htmlTechArticlephp Android use introduction json xml difference an app communication interface three elements: 1. interface address :( http://app.com/api.php? Format = xml) 2. interface file: (api. php handles some business logic...