Preface:
First of all, I think this example is very simple. As an android engineer, it is necessary to understand or develop the server background, write some interfaces, and so on, because the technology changes very quickly, but they all have some commonalities, in the process of constantly learning the language, discover things that do not change, to improve yourself. Recently, I think PHP is quite simple. I will share it with you next time.
1. My design idea is probably like this,
General ideas:
View is the controls that can be used on the mobile phone end. After a trigger event is clicked, it is handed over to the Controller, requesting the server servlet. After the server receives the request, it can see what it is, then, obtain the corresponding value from the database and encapsulate it into an Entity Bean. Finally, convert the object to JSON format and return it to the client.
2. I did this thing about registration and login cases.
Step 1: Design the attributes of the database fields. First, set four fields:
Int ID varchar name varchar passwd varchar mail
User ID username User Password email
Here we use MySQL. First, we create a table in a database, that is, the statement used by the user to create this table is as follows:
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) DEFAULT NULL, `passwd` varchar(30) DEFAULT NULL, `mail` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`))
After setting up, you can insert a data record for testing.
[Integrated development environment I used: xmapp, which is an open-source and very useful environment]
This is the case after creation.
Next, I began to design Java Web, namely Serlvet.