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.