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

Write the first app interface in java

little bottle
Release: 2019-04-27 16:39:21
forward
4729 people have browsed it

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!

Related labels:
source:jianshu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template