For a mobile app API design example?

Source: Internet
Author: User
PHP as a service-side Android, Apple as a client, PHP API interface should be designed to solve the new and old version and Android and Apple version inconsistency, 2. How to design the interface to ensure the scalability and flexibility of the function
Can you give us a complete example or a way of thinking about it?


Reply to discussion (solution)

It's too much, but the core is a little bit, the calling interface backwards compatible, back data backwards compatible

It's too much, but the core is a little bit, the calling interface backwards compatible, back data backwards compatible

I'm not sure I can tell you more.

The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters

1, design a version of the table, there are cell phone Type field, version number and other fields, check the time, according to the two fields to find the ID, and then check the cell phone Type field the highest ID, compare, big on the prompt to have version update
2, do not know

The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters

Can understand the Andro and Apple interface to separate the same thing the service side to divide two, increase the maintenance amount

The service side is a sub-component.


The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters

Can understand the Andro and Apple interface to separate the same thing the service side to divide two, increase the maintenance amount

I am a copy of the processing logic for iOS and Android most of them are the same, and different places are written separately

The inconsistency of the place is written separately, is not the if else. As for extensibility and flexibility, this does not know where to start, a few more changes.

PHP (underlying) <--> Java (middle tier) <---> Client (ios/android)


The PHP side only to do logic processing, including updating the database and so on;

Java side to do data format conversion and processing (LZ questions can be placed in the middle layer)

The client will be able to display the data directly from Java.

Thank you for your enthusiastic reply.

  • Related Article

    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.