How can I design mobile app APIs?

Source: Internet
Author: User
How can I design mobile app APIs? Php is the Android server, Apple is the client, and php is designed to solve the inconsistency between the old and new versions, Android and Apple versions when providing API interfaces. 2. how to design interfaces to ensure the scalability and flexibility of functions
Could you give me a complete example or give me some ideas?


Reply to discussion (solution)

This is too extensive, but the core point is that the calling interface is backward compatible, and the returned data is backward compatible.

This is too extensive, but the core point is that the calling interface is backward compatible, and the returned data is backward compatible.

I don't quite understand. could you elaborate?

All Request interfaces Upload versions and sources (ios or android). you can return different data based on these two parameters.

1. design a version table with fields such as the mobile phone type field and version number. check the IDs based on the two fields, and then check the highest ID of the mobile phone type field for comparison, if it is large, a version update is prompted.
2. unknown

All Request interfaces Upload versions and sources (ios or android). you can return different data based on these two parameters.

It can be understood that the interfaces of Android and Apple must be separated from those of the same thing. the server must be divided into two parts, increasing the maintenance workload.

Server? What is the score? .


All Request interfaces Upload versions and sources (ios or android). you can return different data based on these two parameters.

It can be understood that the interfaces of Android and Apple must be separated from those of the same thing. the server must be divided into two parts, increasing the maintenance workload.

I am a copy. most of the processing logic of ios and android is the same, but they are written separately.

If they are different, write them separately. isn't it if else. As for scalability and flexibility, I don't know where to start. just change it several times.

Php (underlying) <--> java (middle layer) <---> client (ios/android)


Php only performs logic processing, including updating the database;

Data format conversion and processing in java (lz's questions can be placed in the middle layer)

The client can directly display data from java.

Thank you for your enthusiastic answers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.