Home >Java >javaTutorial >Write the first app interface in java

Write the first app interface in java

little bottle
little bottleforward
2019-04-27 16:38:124726browse

This article uses Java to write a simple app interface, which has certain reference value. The most important thing is this process and ideas. Friends who are interested can learn about it. I hope it can be helpful to you.

1 Install MyEclipse. There is no need to configure the Java environment for Android.

2 Configure tomcat

3 Download gson, jar package, add dependencies, and put it under webRoot/web-inf/lib

4 Create web project

5 Write a LoginServlet to integrate httpServlet and rewrite the doPost() and doGet() methods. The code is as follows

Write the first app interface in java

Related tutorials:Android video tutorial

6 Modify web.xml as follows

Write the first app interface in java

7 Deploy the project to tomcat as follows

Write the first app interface in java

8 Open the web page at localhost:8080/repairs/login?name=123&pwd=12.13556 and return the following results

{"result":"1","pwd":"12.13556","name":"123"}, here is the get request.

9 This localhost phone is inaccessible. We use proxy charles. Please download and install the configuration by yourself.

10 Android post request, return data, and you're done.

Related tutorials: Java video tutorial

The above is the detailed content of Write the first app interface in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jianshu.com. If there is any infringement, please contact admin@php.cn delete
Previous article:What is java jdk?Next article:What is java jdk?