Environment construction of epatch development log

    Based on the preparatory work in the previous stage, we started the connection between the front-end and the back-end. The development environment of the overall APP is Android Studio+PHP+MySQL, and we use the integrated Wamp for PHP and MySQL.

      The interaction between the front-end and the back-end of the mobile terminal is similar to the interaction principle of the front-end and the back-end of the web. The mobile terminal acts as the function of the webpage in the web project, collects user input, and displays the results of the interaction with the database. PHP is the bridge between the mobile terminal and the database. The database and database operations are also completed by PHP. The results of PHP operations on the database can be distinguished by different return states, and the information is sent back to the front end in json format text. After the front end parses, it will respond appropriately.

      Taking a simple login as an example, the user enters the username and password on the mobile terminal (that is, the front desk), the Android terminal uses the POST method to transfer the data to the background, and points to the login.php file through the URL through HttpURLConnection, and PHP connects to the database. Search the database with the user name of the user, and after finding the corresponding user, compare the password received from the front end with the user's password stored in the database to determine whether they are consistent. If they are consistent, the login is successful. prompt information.

       

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325282711&siteId=291194637